Usb Host Shield Library 2.0 (PS3BT) communication Watchdog issues

Background: Im working with a robot which is to be controlled with a PS3 bluetooth gamepad. Im using the Arduino 2560 Mega and the Sparkfun USB Host with a bluetooth dongle for gamepad interfacing.

I have got the communcation up and running with the USB Host Shield Library 2.0.

Issue/Question: I would like to have a watchdog between the PS3 Gamepad and the Usb Host Shield. So if the communication goes down the motors controlling the robot is shut off. I have tried to use PS3.PS3Connected bit, but it seems to stay high when the communication are interrupted and the joystick input values freezes at the interrupt point.

I also would like to be able to detect communication error between the USB Host Shield and the Arduino Mega.

Are there any complete functions in the library that I can utilize to achive this functionallity? Why does not the PS3.PS3Connected go low when communications is interrupted?

You can simply use the function "getLastMessageTime()" to check when the PS3 last sent any data. You can then assume it is disconnected if it hasn't send data in a while.

Regards Kristian Sloth Lauszus

Lauszus: You can simply use the function "getLastMessageTime()" to check when the PS3 last sent any data. You can then assume it is disconnected if it hasn't send data in a while.

Regards Kristian Sloth Lauszus

Thanks, work like a charm!

Lauszus: You can simply use the function "getLastMessageTime()" to check when the PS3 last sent any data. You can then assume it is disconnected if it hasn't send data in a while.

Regards Kristian Sloth Lauszus

Hello Cristian , really a great job ! I have the same necessity for the xboxrecv , in that line I can put a timer to see if the input signals are updated ? or is there a function like for ps3

if I lose the batteries while I'm at maximum throttle nobody can stop my boat