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 #include "mbed.h" 00002 00003 Serial pc(USBTX, USBRX); 00004 00005 InterruptIn button1(p12); 00006 InterruptIn button2(p11); 00007 InterruptIn button3(p10); 00008 00009 void button1_pressed() {pc.printf("Button 1");} 00010 void button2_pressed() {pc.printf("Button 2");} 00011 void button3_pressed() {pc.printf("Button 3");} 00012 00013 int main() 00014 { 00015 // Set up buttons 00016 button1.mode(PullDown); 00017 button1.rise(&button1_pressed); 00018 00019 button2.mode(PullDown); 00020 button2.rise(&button2_pressed); 00021 00022 button3.mode(PullDown); 00023 button3.rise(&button3_pressed); 00024 00025 while (1); 00026 }
Generated on Sat Aug 20 2022 20:23:44 by
1.7.2