Go Down

Topic: I can't use readbytes() to byte* buffer (Read 567 times) previous topic - next topic

deLucast

Lol thank you!
I think that so ridiculous when "readbyte()" cannot read Byte. Because I have to work with range 0 to 255.
And michinyon's solution may work but forcing to char* will change the value in range -128 to 127.
I ve just figued out myseft this way, but little bit quite not fun :(
Code: [Select]
 if( Serial.available() > 1){
   recData[0] = Serial.read();
   recData[1] = Serial.read();

AWOL

Quote
And michinyon's solution may work but forcing to char* will change the value in range -128 to 127.
It doesn't change any values. The binary value remains the same, but it is up to you how to interpret it.

0xff == 25510 == -1
"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.

Go Up