May 15, 2018
I am trying to get Edison to move with the DVD remote. I want Edison to continue moving when I am holding down the button on the remote. However, with my code he just moves 5 cm and then I have to press the button again to have him move another 5 cm. What can I add to my code so that he continuously moves as long as I am holding the remote button down?
remoteValue = Ed.ReadRemote()
if remoteValue == 0:
Ed.Drive(Ed.FORWARD, Ed.SPEED_6, 5)
August 24, 2015
heres a good example of the basic program:
You can extend this to accept more remote codes by adding more “elif” statements
May 13, 2018
When you press a button on the remote it blasts the same code over and over again to the Edison. This is to increase reliability, since you have no guarantee that any one message will make it through. I suspect on the Edison (and on your TV) once a message is received a timeout period is activated that either waits for a length of time before responding again, or more likely waits till the command is no longer received before preparing to process the next message.
Without this timeout pressing a button on your remote would result in many precieved button presses at the Edison robot or TV. In other words typing 5 to turn to channel 5 would result in the TV seeing the number 5555555555555555555.
If you want to continually drive you can change the logic around so that pressing a button flips the robot to a new state. So pressing forward will switch from idle to driving leaving the motors running until you hear a turning or stop signal from the remote. Then rather than holding down the forward button you simply press and release it and the robot will drive forward until you press and release a different button.