8. Case 04: Remote Control with Joystick:bit V2¶
8.3. Picture¶
8.4. Software Programming¶
Click “Advanced” in the MakeCode drawer to see more choices.
For programming, we need to add a package: click “Extensions” at the bottom of the MakeCode drawer and search with “https://github.com/elecfreaks/pxt-Dronebit” in the dialogue box to download it.
Notice: If you met a tip indicating that some codebases would be deleted due to incompatibility, you may continue as the tips say or create a new project in the menu.
8.5. Program¶
The Remote Control Part:¶
Link: https://makecode.microbit.org/_9Lw8CEM6mPYt
You can also download it directly:
The Drones Part:¶
Link: https://makecode.microbit.org/_05Hc6fTUcRTr
You can also download it directly:
8.6. Result¶
Turn on the Joystick:bit V2 and the drone, you can send commands via Joystick:bit V2 after its vibration.Each command is only working after the Joystick:bit V2 gets vibrated.The flying directions could be controlled by the stick.Press button to fly the drone and button B to give landing command.Press button C to make the drone rotate left in 90 degrees and button F to rotate right in 90 degrees.Press button D to add the altitude and E to lower it.