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.
Dependencies: mbed
Beleuchtungssteuerung.cpp@8:fb6cb712eb52, 2015-05-26 (annotated)
- Committer:
- thorb3n
- Date:
- Tue May 26 12:14:44 2015 +0000
- Revision:
- 8:fb6cb712eb52
- Child:
- 9:b1bf6699d610
beleuchtung
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| thorb3n | 8:fb6cb712eb52 | 1 | # include "mbed.h" |
| thorb3n | 8:fb6cb712eb52 | 2 | # include "Prototypen.h" |
| thorb3n | 8:fb6cb712eb52 | 3 | PwmOut pwm_Licht(PWM_PORT);// Edit Pin-Port for the frontlight mosfet |
| thorb3n | 8:fb6cb712eb52 | 4 | DigitalOut bremsen(PA_6); // Edit Pin-Port for the backlight |
| thorb3n | 8:fb6cb712eb52 | 5 | Timer timer; |
| thorb3n | 8:fb6cb712eb52 | 6 | Bremse_blinken(){ |
| thorb3n | 8:fb6cb712eb52 | 7 | int bremse; |
| thorb3n | 8:fb6cb712eb52 | 8 | bremse = break_value(); // reads break value |
| thorb3n | 8:fb6cb712eb52 | 9 | bremsen=0; |
| thorb3n | 8:fb6cb712eb52 | 10 | while(bremse){ // starts if break value = 1 |
| thorb3n | 8:fb6cb712eb52 | 11 | timer.start(); |
| thorb3n | 8:fb6cb712eb52 | 12 | if(timer.read()>0.5){ // backlight(bremsen) blinks with 1 Hz |
| thorb3n | 8:fb6cb712eb52 | 13 | bremsen=!bremsen; |
| thorb3n | 8:fb6cb712eb52 | 14 | timer.reset(); |
| thorb3n | 8:fb6cb712eb52 | 15 | } |
| thorb3n | 8:fb6cb712eb52 | 16 | } |
| thorb3n | 8:fb6cb712eb52 | 17 | } |
| thorb3n | 8:fb6cb712eb52 | 18 | Vorderlicht_steuerung(){ |
| thorb3n | 8:fb6cb712eb52 | 19 | |
| thorb3n | 8:fb6cb712eb52 | 20 | pwm_Licht.period_us(10000); |
| thorb3n | 8:fb6cb712eb52 | 21 | while(1){ |
| thorb3n | 8:fb6cb712eb52 | 22 | pwm_Licht.pulsewidth_us(10000*0.5);// Bluetooth eingabe einfügen |
| thorb3n | 8:fb6cb712eb52 | 23 | } |
| thorb3n | 8:fb6cb712eb52 | 24 | |
| thorb3n | 8:fb6cb712eb52 | 25 | } |