Send a string and number together by radio
to other Calliope minis.
The maximum string length is 12 characters.
radio.sendValue("name", 0);
This program sends your Calliope mini’s acceleration (amount it is
speeding up or slowing down) in the x
direction (left and right) to
other Calliope minis. This kind of program might be useful in a model car
or model rocket.
radio.setGroup(99)
input.onButtonPressed(Button.A, () => {
radio.sendValue("acc", input.acceleration(Dimension.X))
})
This program receives the string and number sent by the last program. Then it shows them on the LED screen.
radio.setGroup(99)
radio.onDataPacketReceived(({ receivedString, receivedNumber }) => {
basic.showString(receivedString);
basic.showNumber(receivedNumber);
});
radio