Hello, I’m new to this forum. I am trying to create a UART between an Arduino Uno and a Numaker M263A. I think i have the UNO side of things set programmatically, but I need help with the mbed side. Are there any code examples out there?
Can anyone help point me to the right path please?
I’m playing around with this code in the Numaker to start:
// Create a DigitalOutput object to toggle an LED whenever data is received.
static DigitalOut led(LED1);
// Create a BufferedSerial object with a default baud rate.
static Serial serial_port(D0, D1);
int main(void)
{
if (serial_port.readable())//compilation error here {
char data_rec = serial_port.read();// and here
if (data_rec == '1') digitalWrite(led, HIGH);
if (data_rec == '0') digitalWrite(led, LOW);
}
}
Thank you!