Started following some tutorial on att85 usi. Downloaded example code from make avr book.

This commit is contained in:
Dan
2022-09-20 01:08:01 -04:00
parent d0cbc0000e
commit 361a828c46
295 changed files with 68746 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
/* Functions for serial port output formatting and input */
#include "_servoSerialHelpers.h"
void printTime(uint8_t hours, uint8_t minutes, uint8_t seconds) {
printByte(hours);
transmitByte(':');
printByte(minutes);
transmitByte(':');
printByte(seconds);
transmitByte('\r');
transmitByte('\n');
}
void pollSerial(void) {
/* Poll for serial input -- to set the time. */
char input;
if (bit_is_set(UCSR0A, RXC0)) {
input = UDR0;
if (input == 'S') { /* enter set-time mode */
printString("Setting time...\r\n");
printString("Hour: ");
hours = getNumber();
printString("\r\nMinutes: ");
minutes = getNumber();
printString("\r\nSeconds: ");
seconds = getNumber();
printString("\r\n");
ticks = 0;
if ((hours >= START_TIME) && (hours < STOP_TIME)) {
setServoPosition();
}
}
}
}