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
- Committer:
- ogata_lab
- Date:
- 2013-07-04
- Revision:
- 0:0c2f82ec4865
File content as of revision 0:0c2f82ec4865:
#include "mbed.h" #include "Serial.h" DigitalIn sw01(p20); Serial usbSerial(USBTX, USBRX); bool old_sw = false; int main() { sw01.mode(PullUp); usbSerial.printf("Hello World!"); int i = 0; while(1) { bool new_sw = sw01; if(new_sw && !old_sw) { i++; } usbSerial.printf("Counter = %d¥r¥n", i); old_sw = new_sw; } }