Skip to content

Commit

Permalink
add front flip and back flip capabilities to step 6
Browse files Browse the repository at this point in the history
  • Loading branch information
tobby-s authored and deadprogram committed Mar 3, 2025
1 parent 29de38d commit 2625e08
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drone/minidrone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 8 additions & 0 deletions drone/minidrone/step6/joystick.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit 2625e08

Please sign in to comment.