Go Down

Topic: About Serial.read (Read 17 times) previous topic - next topic

coos

The document show me that Serial.read returns the first byte of incoming serial data available .
ex:  I send "hello" to arduino,it returns me ony "h".
Is there any way to get more byte per one time?
thanks.

AWOL

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

coos


AWOL

#3
Jan 22, 2011, 05:26 pm Last Edit: Jan 22, 2011, 05:32 pm by AWOL Reason: 1
If you look at Serial.read, it returns an int.
The only reason it doesn't return a char is because if there is no data to read, it returns -1.
It can't return more than one characer at a time.

Is that a problem for you?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

pluggy

Hint : you read it more than once........

Go Up