#include <stdio.h>
#include <avr/io.h>
#include "HD44780.hpp"
#include "libADC.hpp"
#include "uart_buffer.hpp"
#include "Arduino.h"
int main() {
LCD_Initalize();
LCD_GoTo(0, 0);
LCD_WriteText((char*)"operations:");
LCD_GoTo(0, 1);
LCD_WriteText((char*)"0, 1");
ADC_Init();
// initialize Serial (UART) communication
uart_init(9600,0);
sei(); // unlock the interrupts
uint8_t data;
while (1) {
// LAB 3
if (uart_read_count() > 0) {
data = uart_read();
// when key '0' is pressed
if (data == '0') {
// do something
uart_send_byte('*');
}
// when key '1' is pressed
else if (data == '1') {
// do something else
uart_send_byte('_');
}
else {
// send received sign as echo
uart_send_byte(data);
}
}
}
//_delay_ms(100);
return 0;
}