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.
Tasten am M0Board
Das M0Board hat vier Taster (siehe Abbildung) auf die mittels DigitalIn bzw. BusIn zugeriffen werden kann. Für das Entprellen von Taster kann Debouncer verwendet werden (siehe Code).
#include <Debouncer.h> // Entprellen von Tasten PwmOut red(p36); PwmOut green(p5); PwmOut blue(p34); DigitalOut led1(LED1); DigitalOut led2(LED2); DigitalOut led3(LED3); DigitalOut led4(LED4); DigitalIn sw2(P0_10); DigitalIn sw3(P0_23); DigitalIn sw4(P1_16); //DigitalIn sw1(P0_15); Debouncer sw1(P0_15); void fall(void) { ... } int main() { sw1.attach_fall(&fall); //.attach_rise(&rise); blue=green=1; // ... }