General

Infrared Laser Distance Sensor (50m/80m)

userHead Account cancelled 2021-05-03 19:09:25 1552 Views1 Replies
I carnt communicate with the Infrared Laser Distance Sensor (50m/80m) sensor.
Ive wired it up exactly as shown in the tutorial and copyied the code.
I get the error
sketch_may03b.ino:12:34: warning: narrowing conversion of '128' from 'int' to 'char' inside { } [-Wnarrowing]
char buff[4]={0x80,0x06,0x03,0x77};
^
Please help
2021-05-07 17:56:40 Your array is defined with char, but the content is of type uint8_t, so you need to change one of them. The definition and content type should be consistent.
If your intention is to convert ascii codes into characters, it is best to use characters directly.
userHeadPic 347945801