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.
You are viewing an older revision! See the latest version
Lösung DigitalAus1
#include "mbed.h" class DigitalAus : public DigitalOut { public: DigitalAus(PinName ld) : DigitalOut(ld,0){} int lese() { return read(); } void schreibe(int value) { write(value); } using DigitalOut::write; void write(int value, bool t) { printf("Ätsch"); } void blink10Mal(int zeit) { int i=0; while( i < 10) { write(1); wait_ms(zeit); write(0); wait_ms(zeit); i++; } } void blink10Mal() { int i=0; while( i < 10) { write(1); wait_ms(500); write(0); wait_ms(500); i++; } } }; DigitalAus led(LED1); int main() { printf("Blink 10 Mal\n"); led.blink10Mal(100); printf("Blink 10 Mal end\n"); while (1) { led.write(0); printf("Blink! LED is now %d\n", led.read()); wait_ms(500); led.write(1); printf("Blink! LED is now %d\n", led.read()); wait_ms(500); } }