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:
- jksoft
- Date:
- 2011-08-26
- Revision:
- 0:c886b74709da
File content as of revision 0:c886b74709da:
#include "mbed.h" Serial pc(USBTX, USBRX); // tx, rx DigitalIn sw(p5); int main() { int old = sw; int count = 0; sw.mode(PullUp); pc.printf("Counter!"); while(1) { if((sw == 0)&&(old == 1)) { count++; printf("%d\r\n",count); wait(0.2); } old = sw; } }