Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Contains Code to allow BLE control over GPIOs
"""
@file bbc_recieve
@brief BBC microbit Receiver By Inderpreet Singh
"""
import radio
import random
from microbit import display, Image, button_a, sleep
radio.on()
def mOn():
pin0.write_digital(1)
def mOff():
pin0.write_digital(0)
def lOn():
pin1.write_digital(1)
def lOff():
pin1.write_digital(0)
# Event loop.
while True:
# Incomming
incoming = radio.receive()
if incoming == 'm-on':
mOn()
elif incoming == 'm-off':
mOff()
elif incoming =='l-on':
lOn()
elif incoming = 'l-off':
lOff()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment