39#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__)
40 WDTCSR |= _BV(WDCE) | _BV(WDE);
41 WDTCSR = _BV(WDIE) | _BV(WDE) | _BV(WDP3) | _BV(WDP2) | _BV(WDP1);
65#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__)
81 static uint16_t BufferCnt = 0;
82 String str1, str2, str3, str4, str5, str6;
85 if (incomingByte ==
'\n' || incomingByte ==
'\r') {
86 buffer[BufferCnt] = 0;
87 if (buffer[0] ==
'G' && buffer[1] ==
'S') {
92 }
else if (buffer[0] ==
'G' && buffer[1] ==
'E') {
97 }
else if (buffer[0] ==
'R' && buffer[1] ==
'B') {
103 buffer[BufferCnt] = incomingByte;
Class that functions for interacting with a RS485 transceiver.
uint8_t available(void)
The number of chars/uint8_t that are available in RS485 buffer.
uint8_t read()
Read a char/uint8_t from RS485 bus.
void print(String str)
Print a string to RS485 bus.
void flush()
Waits for the transmission of outgoing serial data to complete.
Class that functions for interacting with a watchdog timer.
void watchdog_reset()
Reset the watchdog timer.
void watchdog_init()
Initialize watchdog timer to 2sec time out and to set up interrupt routine.
#define BUFFER_SIZE
Set the size of serial buffer.
#define MOTOR_EN
Digital output, to enable the motors.
enum _rotator_error rotator_error
Rotator error.
enum _rotator_status rotator_status
Rotator status.