Created
April 28, 2019 18:39
-
-
Save inderpreet/cc42817ee0c7f03bc86841ff4b7d016f to your computer and use it in GitHub Desktop.
Contains Code to allow BLE control over GPIOs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
@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