Hello, it’s my first time to use this forum.
I want to send commands to a sensor. I think I can use Serial.write() , but I got an error like this.
"Error: No instance of overloaded function “mbed::Serial::write” matches the argument list in “main.cpp”
I refer to this page, but I can’t solve the error.
My platform is NUCLEO L432-KC , my code is written below.
#include "mbed.h"
Serial jy901(D1,D0);
int main()
{
const unsigned char unlockCom[5]={0xFF,0xAA,0x69,0x88,0xB5};
jy901.write(unlockCom,5);
for(int i=0;i<10;i++){
printf("%d\n\r",jy901.getc());
}
}
usually is good to also share info Mbed Os version. Anyway it is probably a lower than 6.
This error tell you, the write function is not match to overloaded variants (part of Asynch). The variant what you try to use, come from Stream.h and it is probably not accessible (error from Online compiler).
Thank you for advice!
mbed library varsion is release version 165.
Although I tried to use mbed OS 6.14 , and BufferedSerial class, I can’t use BufferedSerial.getc().
Is there any function instead of getc() in the class ?