DUE Serial communication not working

HI guys,
I tried to upload following sketch onto my DUE (after testing it on the UNO where it perfectly worked)

It compiles and uploads without any issues, but it doesn’t transmit any serial date (nothing visible in the serial monitor and the tx led remains off)
when i send data to turn on the led the rx led lights up but it doesn’t react accordingly (it does nothing)

Any idea what could be wrong?

thank you!!! :wink:

ledpot.ino (4.91 KB)

pot.cpp (203 Bytes)

pot.h (190 Bytes)

You never set inputcomplete false again, you need to do this when capturing the value of inputstring.

Thank you! But why would it run perfectly on the uno then?

Also, something else, I might have missed it, but where (or when) is

void serialEvent()

ever called? This function is were the var "inputcomplete" is set to be true that starts the ball rolling!

David G.

serialEvent() gets called by the Arduino "glue code" after loop() finishes, if there is any serial data in the incoming buffer.

The description in the reference describes it like an interrupt but it can't interrupt your code. It will only run after the end of loop(). If loop never finishes then this can't run.