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.
Homepage
https://os.mbed.com/users/rob117/code/
DreiLed¶
Programmbeschreibung: DreiLeds
Änderungen:
Datum: 06.12.19
dreiLed.cpp
#include "mbed.h" DigitalOut led1(LED1); DigitalOut led2(LED2); DigitalOut led3(LED3); int main() { while (1) { led1 = !led1; wait_ms(20); //100 Hz if (led1==0){ led2 = !led2; wait_ms(10); //50 Hz } if((led1 == 1) && (led2 == 1)) //Wenn led1 und led2 leuchtet soll led3 leuchten { led3= !led3; } } }
LedFunc¶
Programmbeschreibung: LedFunc
Änderungen:
Datum: 06.12.19
LedFunc
#include "mbed.h" DigitalOut led1(LED1); DigitalOut led2(LED2); DigitalOut led3(LED3); DigitalOut led4(LED4); void allLedsOn(); //Funktions Prototyping void allLedsOff(); void changeLed1(); int main() { while (1) { allLedsOn(); wait_ms(500); changeLed1(); wait_ms(500); allLedsOff(); wait_ms(500); } } void allLedsOn() //alle Leds ein { led1 = 1; led2 = 1; led3 = 1; led4 = 1; } void allLedsOff() //alle Leds aus { led1 = 0; led2 = 0; led3 = 0; led4 = 0; } void changeLed1() //wenn Led1 1 ist soll sie aus sein { if(led1==1) { led1=0; } }
LaufDig¶
Programmbeschreibung: LaufLicht
Änderungen:
Datum: 06.12.19
lauflicht.cpp
#include "mbed.h" DigitalOut myled(LED1); DigitalOut myled2(LED2); DigitalOut myled3(LED3); DigitalOut myled4(LED4); int main() { while(1) { myled = 1; wait(0.2); myled = 0; myled2 = 1; wait(0.2); myled2 = 0; myled3 = 1; wait(0.2); myled3 = 0; myled4 = 1; wait(0.2); myled4 = 0; } }