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:
- ohtsuka
- Date:
- 2016-06-12
- Revision:
- 0:6faa2b0370ff
- Child:
- 1:82989f872e3b
File content as of revision 0:6faa2b0370ff:
#include "mbed.h"
#include "MultiClick.h"
DigitalOut myled(LED1);
MultiClick btn(dp24, PullUp);
void clicked(void){
printf("single clicked.\r\n");
}
void d_clicked(void){
printf("double clicked.\r\n");
}
void n_clicked(int times){
printf("%d clicked.\r\n", times);
}
int main() {
btn.attach_clicked(clicked);
btn.attach_doubleclicked(d_clicked);
btn.attach_n_clicked(n_clicked);
while(1) {
myled = 1;
wait(0.2);
myled = 0;
wait(0.2);
}
}