Go Down

Topic: Getting string from serial (Read 308 times) previous topic - next topic

turbine495

Hello,
I want to read an uart sensor that returns a string (RFID tag id). I want to use a software serial port to read the sensor. My question is how do I read whole strings from serial?

MAS3

You don't.

You read serial data, and put that in an array.
Nick Gammon (the master Yoda of the Arduino universe) has a few examples (click) you can try.
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

majenko

And I wouldn't be me if I didn't (yet again) point out my little tutorial and example code: http://hacking.majenko.co.uk/reading-serial-on-the-arduino
Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

MAS3

Hi majenko.
I wasn't aware of that one yet, i'll check it out tomorrow.
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

zoomkat

Quote
My question is how do I read whole strings from serial?


Serial bytes are usually read one at a time from the serial source and formed into a c-string or String for use.
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

Nick Gammon


Go Up