Skip to content

Instantly share code, notes, and snippets.

@kahenteikou
Created August 1, 2020 23:57
Show Gist options
  • Save kahenteikou/b080d764c60f75791b7d6ad8e5ecf5d4 to your computer and use it in GitHub Desktop.
Save kahenteikou/b080d764c60f75791b7d6ad8e5ecf5d4 to your computer and use it in GitHub Desktop.
Microbit school
input.onButtonPressed(Button.A, function () {
radio.sendValue("template", input.temperature())
radio.sendValue("lightly",input.lightLevel())
})
radio.onReceivedValue(function (name: string, value: number) {
if(name == "template") {
basic.showNumber(value)
basic.showString("C")
}
if(name == "lightly"){
basic.showNumber(value)
basic.showString("lightly")
}
})
radio.setGroup(1)
basic.forever(function () {
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment