Hi All,
Moved from the "I2C freeze"
It seems I have have the I2C freeze problem... But I'm new at this stuff, so it is likely that it is just my own error ;-) but:
I’m trying to make an SRF08 to work, I have remember the 2 pullup resistors (1.4K).
And when the SRF08 is powered up it flashes the address, so it is alive, and i know the address.
But my program hangs for ever, on the first I2C write... and just stops there... the mbed just stops with the LED's as my program left them.
I have tried to use the SRF08 lib, same problem…
I have tried both p9+p10 and p28+p27… same problem…
To see if it was a problem with my SRF08, I tryed an CMPS03 but with same result, it hangs for ever on my first write...
Any ideas…my robot is driving around blind and keeps bumping into stuff ;-)
#include "mbed.h"
//#include "SRF08.h"
DigitalOut l1(LED1);
DigitalOut l2(LED2);
DigitalOut l3(LED3);
DigitalOut l4(LED4);
//SRF08 srf08(p9, p10, 0xE0);
Serial pc(USBTX,USBRX);
I2C sonar(p28,p27);
const int addr = 0xE0;
char cmd[2];
char echo[2];
int main() {
pc.printf("Start up v.01 \n");
l1=1;
wait(1);
cmd[0] = 0x02;
cmd[1] = 0x1C;
l2=1;
pc.printf("--->Sonar.write\n");
sonar.write(addr,cmd,2); // <--------------- My program will never exit this line of code.
l3=1;
pc.printf("<---Sonar.write\n");
cmd[0] = 0x01;
cmd[1] = 0x1B;
sonar.write(addr,cmd,2);
l4=1;
pc.printf("Link OK to Sonar \n");
while(1) {
l1=!l1;
wait(0.2);
}
}
Hi All,
Moved from the "I2C freeze"
It seems I have have the I2C freeze problem... But I'm new at this stuff, so it is likely that it is just my own error ;-) but:
I’m trying to make an SRF08 to work, I have remember the 2 pullup resistors (1.4K).
And when the SRF08 is powered up it flashes the address, so it is alive, and i know the address.
But my program hangs for ever, on the first I2C write... and just stops there... the mbed just stops with the LED's as my program left them.
I have tried to use the SRF08 lib, same problem…
I have tried both p9+p10 and p28+p27… same problem…
To see if it was a problem with my SRF08, I tryed an CMPS03 but with same result, it hangs for ever on my first write...
Any ideas…my robot is driving around blind and keeps bumping into stuff ;-)