8 years, 6 months ago.

How to write byte array in Mbed ?

I have been working with a fingerprint module sm630 which have to print a byte array of 8 byte for adding fingerprint . The code for arduino is following . byte addFingerPrint0[] = {0x4D, 0x58, 0x10, 0x03, 0x40, 0x00, 0x00, 0xF8}; 8 bytes Serial.write(addFingerPrint0, sizeof(addFingerPrint0));

byte command is showing error. so please help me with this situation. I need to print the byte array.

1 Answer

8 years, 6 months ago.

byte = char or uint8_t. Then it should work. (Also note that sizeof an array only works if you are doing it directly on the array. That is done here, so it is fine. However if it is another function to which the array has been passed on, it won't work properly).

Accepted Answer