I'm still playing with NXTCam, I tried to put a different firmware, using mindsensors tutorial ( http://www.mindsensors.com/index.php?mo ... ent_id=152 ), adding this
- Code: Select all
else if ( (asciiTokenBuffer[0] == 'C') &&
(asciiTokenBuffer[1] == 'O') )
{
/* the user wants to set registers in the OV6620 */
receivedCmd = echoCmd;
}
and
- Code: Select all
else if (receivedCmd == echoCmd)
{
UIMgr_txBuffer("CO R", 4);
UIMgr_txBuffer("\r\n",2);
}
So, if you send CO you should receive CO R<CR>ACK
It works when I send commands with TeraTerm, but not with NXT. How do you send and receive from I2C sensors?
Something like this?
String command_send = "CO";
buffcommand = command_send.getBytes();
I2Cport.i2cTransaction(I2Csensor.getAddress(), buffcommand, 0, 2, buffresponse, 0, 4);
or using I2CSensor senddata and getdata?
I2Csensor.sendData(int register, byte[] buf, int len);
I2Csensor.getData(int register, byte[] buf, int len);
Thanks!
