How can I read the serial buffer?

+1 vote
asked Mar 1, 2016 by jehan-poublan (450 points)

I want to get what I've written in the serial buffer.

commented Mar 1, 2016 by nicolas-calvet (270 points)
The function to use is " Serial.read()" I guess.

This is the documentation I've found : https://www.arduino.cc/en/Serial/Read

1 Answer

+1 vote
answered Mar 4, 2016 by remi-boulle (360 points)

For example :

int i=0;
  while ( Serial.available() > 0 ) {
    data[i++] = Serial.read();
  }

where data is an unsigned char

Welcome to OpenWiNo Q&A, where you can ask questions and receive answers from other members of the community.
To change your password you must follow THIS link.

24 questions

32 answers

18 comments

37 users

...