Thonners / Helicopter

Scripts to fly a remote-control helicopter, using a Raspberry Pi as the main controller instead of a standard RC receiver unit
GNU General Public License v3.0
0 stars 0 forks source link

Clear stashed GamePad input events on instantiation #8

Open Thonners opened 4 years ago

Thonners commented 4 years ago

If the GamePad is initialised but buttons have been pressed since they were last processed, all the button presses will be in the event queue and will be processed before the actual 'real time' button presses can be done.

On initialisation, clear the event queue as it's not the true current state of the controller, and in case it contains commands that are dangerous/contrary to what the user wants