diff --git a/drone/minidrone/README.md b/drone/minidrone/README.md index a3fe1c5..97ae795 100644 --- a/drone/minidrone/README.md +++ b/drone/minidrone/README.md @@ -98,6 +98,8 @@ Now it is time for free flight, controlled by you, the human pilot. Plug in the * X - Land * Left stick - altitude * Right stick - direction +* L1 - Front flip +* R1 - Back flip IMPORTANT NOTE: you must press the "P3" button when your program first runs for the "clone" DS3 joysticks we are using to fully turn on. diff --git a/drone/minidrone/step6/joystick.go b/drone/minidrone/step6/joystick.go index bebcde8..a772a6d 100644 --- a/drone/minidrone/step6/joystick.go +++ b/drone/minidrone/step6/joystick.go @@ -72,6 +72,14 @@ func startJoystick() { rightY.Store(val) }) + stick.On(joystick.L1Press, func(_ interface{}) { + drone.FrontFlip() + }) + + stick.On(joystick.R1Press, func(_ interface{}) { + drone.BackFlip() + }) + go handleLeftJoystick() go handleRightJoystick() }