It has a small led on the back that flashes,
the code I’m using to see if i can get it to work is
#define CommandRegister 0x00
int New_Address = 248; //0xF8
#define ResultRegister 0x02
int DEBUG = 1;
char unit = 'i'; // 'i' for inches , 'c' for centimeters
float sensorReading =0;
New_Address += 4;
//offset address not sure why this is but it works for this address
// set units for reading out distance
MySonar.setUnit(CommandRegister, New_Address, unit);
// set register for reading
// read data from result register
sensorReading = MySonar.readData(New_Address, 2);
//print out distance
as in the playground example.
I have wired up everything as in the diagram except for the 1.8 kOhm pullup resistor.
I don’t have one so I did the best I could with what i have and I’m getting 1.84 kOhm through 3 resistors.
However I’ve been talking to the guy I got the sensor off and he reckons it should have a 4.7kOhm resistors which I tried, and again i dont have one so I’m getting 4.72kOhm trough 6 resistors this time
and I’m getting the same result.
Distance: 0.00 inches
Is the .04 or .02kOhm going to cause a problem??