Created
October 29, 2016 16:04
-
-
Save NiallEgan/f16e3dec1e7908a487acddbbe62e400c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from microbit import * | |
networkID = 0 # Change the channel variable in the radio.configure to this | |
def selectNetwork(): # Call this function before calling anything else | |
global networkID | |
currentID = networkID | |
while True: | |
if button_a.is_pressed() and button_b.is_pressed(): | |
networkID = currentID | |
display.scroll("Chan." + str(networkID) + "selected") | |
break | |
elif button_a.is_pressed(): | |
currentID = (currentID - 1) % 10 | |
display.show(str(currentID)) | |
elif button_b.is_pressed(): | |
currentID = (currentID + 1) % 10 | |
display.show(str(currentID)) | |
sleep(200) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment