Hovercraft v1. /JL
This commit is contained in:
22
avanceret/hovercraft/remote/main.py
Normal file
22
avanceret/hovercraft/remote/main.py
Normal file
@@ -0,0 +1,22 @@
|
||||
'''
|
||||
This is code for the hovercraft remote
|
||||
'''
|
||||
from microbit import *
|
||||
|
||||
# We start by initiating radio communication
|
||||
# We want a strong signal
|
||||
|
||||
import radio
|
||||
|
||||
radio.config(group=99, power=7)
|
||||
radio.on()
|
||||
|
||||
while True:
|
||||
if accelerometer.was_gesture("down"):
|
||||
radio.send("forward")
|
||||
if accelerometer.was_gesture("up"):
|
||||
radio.send("back")
|
||||
if accelerometer.was_gesture("left"):
|
||||
radio.send("left")
|
||||
if accelerometer.was_gesture("right"):
|
||||
radio,send("right")
|
||||
Reference in New Issue
Block a user