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
Digital I O Grundlegend
Aufgabe 1 [DreiLed]¶
Import programTINF_Test2_DIO_Grundlegend_Bsp01
Aufgabe 1 : DreiLed
// LED 1 100 Hz. 1 Zyklus (Ein/Aus) 100 x in der Sekunde (5ms ein 5 ms aus)
// LED 2 50 Hz 1 Zyklus 50 x in der Sekunde
// Die Geschwinddigkeit kann beliebig mit int ms eingesetllt werden
#include "mbed.h"
DigitalOut led1(LED1, 0);
DigitalOut led2(LED2, 0);
DigitalOut led3(LED3, 0);
int ms = 500;
int main()
{
while (1) {
led1 = 1;
led2 = 1;
led3 = 1;
wait_ms(ms);
led1 = 0;
led3 = 0;
wait_ms(ms);
led1 = 1;
led2 = 0;
led3 = 0;
wait_ms(ms);
led1 = 0;
wait_ms(ms);
}
}
