// Serial write example
// https://arduino.stackexchange.com/questions/90195/send-hex-number-over-serial
void setup() {
Serial.begin(115200);
Serial1.begin(115200); // Serial1 is connected to the custom chip
const size_t packet_length = 6;
uint8_t packet[packet_length] = {0xaa, 0xbb, 0x03, 0x01, 0x03, 0xee};
Serial1.write(packet, packet_length);
}
void loop() {
while (Serial1.available()) {
//Serial.print((char)Serial1.read()); // ascii 'ª»î' which is AA BB 03 01 03 EE in hex (which is a match)
Serial.print(Serial1.read()); // decimal '170 187 3 1 3 238'
}
}