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.
main.cpp
00001 /* See 00002 * http://lancaster-university.github.io/microbit-docs/advanced/ 00003 * for docs about using the micro:bit library 00004 */ 00005 #include "MicroBit.h" 00006 00007 MicroBitMessageBus bus; 00008 MicroBitButton buttonA(MICROBIT_PIN_BUTTON_A, MICROBIT_ID_BUTTON_A); 00009 MicroBitDisplay display; 00010 00011 void onPressed(MicroBitEvent e) 00012 { 00013 display.print("S"); 00014 } 00015 00016 int main() 00017 { 00018 scheduler_init(bus); 00019 00020 bus.listen(MICROBIT_ID_BUTTON_A, MICROBIT_BUTTON_EVT_CLICK, onPressed); 00021 00022 while(1) 00023 fiber_sleep(1000); 00024 }
Generated on Mon Aug 15 2022 10:45:05 by
1.7.2