Hi
I have a SRF10 range measure thing connected to my Arduino UNO as shown on the attached image. The specs can be found at
http://www.acroname.com/robotics/parts/R241-SRF10.html - 5v to +
- Ground to -
- SDA to A4
- SCL to A5
I have tried the example program for SRFxxx provided with the Arduino IDE. That did not work. The program stopped at Wire.endTransmission(); and did not go any further.
Then i thinked that it might be the adress that was wrong. Therefore I found a IC2 scanner, which unfortunatly also stops at this point. The output of the program below is
I2C Scanner
Scanning...
, so this also stops at Wire.endTransmission();
#include <Wire.h>
void setup()
{
Wire.begin();
Serial.begin(9600);
Serial.println("\nI2C Scanner");
}
void loop()
{
byte error, address;
int nDevices;
Serial.println("Scanning...");
nDevices = 0;
for(address = 0; address <= 127; address++ )
{
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
{
Serial.print("I2C device found at address 0x");
if (address<16)
Serial.print("0");
Serial.print(address,HEX);
Serial.println(" !");
nDevices++;
}
else if (error==4)
{
Serial.print("Unknow error at address 0x");
if (address<16)
Serial.print("0");
Serial.println(address,HEX);
}
}
if (nDevices == 0)
Serial.println("No I2C devices found\n");
else
Serial.println("done\n");
delay(8000); // wait 8 seconds for next scan
}
Can you help me find out why things just stops.