Friday, July 18, 2014
Wednesday, July 16, 2014
Arduino waitForButtonPress function
Lots of programming robotics languages (RobotC, leJOS NXJ, Cricket Logo, NXT-G) have functions that allow you to suspend processes while waiting for some kind of input. My robotics students most learned about leJOS NXJ's Button.waitForAnyPress() method. When we moved on to programming Arduinos one of them wanted to use the same concept to run a sensor calibration routine in setup(). So we had to make one, and it turned out to be very easy. She was initially trying to do something complicated with boolean variables but I remembered using this simple construct in
Subscribe to:
Posts
(
Atom
)