Created
January 21, 2021 16:04
-
-
Save gaspart/10776ce10c05ec68d73dae8674f3f02d to your computer and use it in GitHub Desktop.
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
""" | |
trasmettitore micro:bit | |
""" | |
radio.set_group(1) | |
radio.set_transmit_power(1) | |
def on_forever(): | |
radio.send_string("1") | |
basic.pause(200) | |
basic.forever(on_forever) | |
""" | |
ricevitore micro:bit | |
""" | |
def on_received_string(receivedString): | |
global segnale | |
segnale = radio.received_packet(RadioPacketProperty.SIGNAL_STRENGTH) | |
led.plot_bar_graph(Math.map(segnale, -95, -42, 0, 9), 9) | |
radio.on_received_string(on_received_string) | |
segnale = 0 | |
radio.set_group(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment