-
-
Save dirkakrid/446c9be8bed0d520ca2b090c55e43882 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