Skip to content

Instantly share code, notes, and snippets.

@gaspart
Created January 21, 2021 16:04
Show Gist options
  • Save gaspart/10776ce10c05ec68d73dae8674f3f02d to your computer and use it in GitHub Desktop.
Save gaspart/10776ce10c05ec68d73dae8674f3f02d to your computer and use it in GitHub Desktop.
"""
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