how to Serial.read() in HEX?


i have ifid device?
i send 0xaa,0xbb,0x02,0x20,0x22?
it should return card id in hex .
but receive can't read x.??.


unsigned char qingqiu[]={0xaa,0xbb,0x02,0x20,0x22};

void setup() {
 serial.begin(19200);
}

void loop() {
serial.write(qingqiu,5);
delay(100);
string = "";
a+=serial.read();

serial.println(a);
serial.flush();
delay(1000);

}

before use serial.read must make sure there read.
do serial.available call , read data when there data read.


Arduino Forum > Using Arduino > Programming Questions > how to Serial.read() in HEX?


arduino

Comments

Popular posts from this blog

VIDIOC_S_FMT error 16, Device or resource busy - Raspberry Pi Forums

using a laptop skeleton to build a pi laptop - Raspberry Pi Forums

Forum for Joomla? - Joomla! Forum - community, help and support