by l3v3rz » Sun Aug 15, 2010 7:53 pm
by l3v3rz
Sun Aug 15, 2010 7:53 pm
I can't see any thing wrong with it. Can you try starting at register 0 and read 4 bytes and see if you get the firmware version ?
so something like:
- Code: Select all
wckMotion wmt = new wckMotion("COM5", true);
wmt.I2C_write(0xC0, new byte[] {0});
byte[] ib = wmt.I2C_read (0xC1, new byte[] {}, 4);
Console.WriteLine("ver={0}, bear={1}",ib[0], ib[1]));
Otherwise it can really be one of following:
1. my code in DCMP - although it works with Accelerometer, may be timing is off for compass.
2. hardware connection on compass to RBC ? Have you scope it up and seen any data transfer? I assume you've checked its in I2C mode and not PWM mode.
3. robobuilderlib not correctly sending data to DCMP - you could try loading BASIC and running that at least then you're cutting out the PC and the robobuilderlib out of equation
Without the hardware its hard to help, but if you do find any problems with the code do let me know so I can update the library.
good luck
I can't see any thing wrong with it. Can you try starting at register 0 and read 4 bytes and see if you get the firmware version ?
so something like:
- Code: Select all
wckMotion wmt = new wckMotion("COM5", true);
wmt.I2C_write(0xC0, new byte[] {0});
byte[] ib = wmt.I2C_read (0xC1, new byte[] {}, 4);
Console.WriteLine("ver={0}, bear={1}",ib[0], ib[1]));
Otherwise it can really be one of following:
1. my code in DCMP - although it works with Accelerometer, may be timing is off for compass.
2. hardware connection on compass to RBC ? Have you scope it up and seen any data transfer? I assume you've checked its in I2C mode and not PWM mode.
3. robobuilderlib not correctly sending data to DCMP - you could try loading BASIC and running that at least then you're cutting out the PC and the robobuilderlib out of equation
Without the hardware its hard to help, but if you do find any problems with the code do let me know so I can update the library.
good luck