Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
receiver_radio_test.cpp
- Committer:
- cristianobarbosa
- Date:
- 2018-01-26
- Revision:
- 0:8ef53042688f
File content as of revision 0:8ef53042688f:
#include "MicroBit.h"
MicroBit uBit;
void onData(MicroBitEvent){
ManagedString s = uBit.radio.datagram.recv();
if(s == "Ola ZE!"){
uBit.display.scroll(s);
}
}
int main(){
uBit.init();
uBit.messageBus.listen(MICROBIT_ID_RADIO, MICROBIT_RADIO_EVT_DATAGRAM, onData);
uBit.radio.enable();
uBit.display.print("waiting...");
while(1)
uBit.sleep(1000);
}