Go Down

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

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

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.
Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.

Nick Gammon

I have an RFID reader sketch here:

http://www.gammon.com.au/forum/?id=11283
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy