hi guys.
how can i get a word from serial monitor and then convert it to hexadecimal and save it to an byte?
my code is not completed:
byte incomingByte [16];
void setup()
{
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
Serial.println("hi. pls write a word :");
}
void loop()
{
byte n = Serial.available();
if( n !=0)
{
byte m = Serial.readBytesUntil('\n', incomingByte, 16);
incomingByte[m] = '\0'; //add null character
}
}