avardy
YaBB Newbies
Posts: 12
|
Thanks very much for the reply! Here is the program I am executing: int low; for (int i=0; i<10; i++) { printf("i: %d\n", i); if (i >= 5) { low = readi2c(0x02, 0x42); // printf("low: %d\n", low); printf("Read something\n"); } delay(500); } printf("battery status: %d\n", battery()); exit(0); The purpose of the outer loop is to show that we have some output produced to the console prior to calling 'readi2c'. Here is the output: i: 2 i: 3 i: 4 i: 5 I have no idea why I never see "i: 1" but that seems to be a consistent issue, perhaps related to my own Java program for talking to the SRV-1. The main point is that there is no response to 'readi2c'. If I comment out the 'readi2c' line then things proceed as expected. Things I've tried: - I tried using another I2C device (with a different address) and still cannot get a response. I am using the address of 0x02 as this is reported online as the I2C address of this compass. From what I can tell, it does not conflict with the I2C address map of the SRV-1. However, there seems to be some wierdness around these addresses that I don't understand. - I made an attempt to talk to the camera via I2C, but this also didn't work out (I tried this with and without the compass, and tried talking to the compass with and without the camera). -I have re-checked my wiring... I have pin 14 on the header connected to the device's SCL line and pin 15 connected to SDA. The compass expects 4.3V power (from the Lego NXT) while I am only supplying 3.3V from the SRV-1. However, I have a very knowledgable colleague who reverse engineered the compass and tells me that all of the logic on-board is actually 3.3V. Any information on the SRV-1 addressing system would be appreciated! Or perhaps suggestions of things to try in order to isolate the problem.
|