July 12, 2018
I’ve been building a Lego car using a remote control to drive and steer. I can’t work out however how to respond to the button press/lift from the remote control to start/stop actions on the Edison. The inbuilt IR control seems to be able to act this way — it continues to perform the programmed action while the button is down, and stops when it’s lifted.
Is there any way to do this in EdWare or EdPy?
August 24, 2015
I think the best way for you to learn how to program your car using the remotes will be to quickly read through our EdCrane tutorial. In the tutorial, it will run through how to program with both EdWare and EdPy. The key to the way we have written the code for the crane is to put the IR reading inside a while loop.
July 12, 2018
Thanks for your reply and taking the time out to help.
I’ve looked into both versions of the crane control and tested a minimal example of my own as well as both of the full versions. It appears that the program as written causes the motor to move for a short period before the motor stops, regardless of the button state on the remote. To move the motor more or less continuously takes consistent button presses.
In contrast, the built in IR program allows the motor to continue running while a button is pressed and stop when the button is released. It is this second kind of behaviour that I’m trying to achieve.
The Lego model we’ve built uses one motor for forwards/backwards, and the other for operating the rack and pinion.
I have a working program in EdWare that reads the remote state and gets the motors rolling, using the buttons to speed up and slow down with different button presses. This is good for forwards/reverse motion, but for steering it would be better to have the motor continue to spin while the button is depressed and stop when it’s released.