/*
Filename: serialMonitorTest
Author: George Howard
Date: 13/03/2024
Description: This is a simple program to test the Arduino Serial Monitor functionality.
*/
#include <avr/io.h>
#include <util/delay.h>
int main(void) {
init(); // Arduino initialisation (including serial ports)
char in_byte;
String out=" Waiting for the serial data";
Serial.begin(9600);
while(true) {
// This checks when there is serial data loaded into the buffer from an external source
if (Serial.available() > 0) {
in_byte = Serial.read();
}
if (in_byte == '1') {
out = "Number 1 Received";
} else if (in_byte == '2') {
out = "Number 2 Received";
}
Serial.println(out);
_delay_ms(1000);
}
}