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@9:b1bf6699d610, 2015-05-26 (annotated)
- Committer:
- scooter_project
- Date:
- Tue May 26 13:40:12 2015 +0000
- Revision:
- 9:b1bf6699d610
- Parent:
- 8:fb6cb712eb52
- Child:
- 12:bad33209d1bb
bremsenergier?ckgewninnug mit funktion akkuladen
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; |
| scooter_project | 9:b1bf6699d610 | 6 | |
| thorb3n | 8:fb6cb712eb52 | 7 | Bremse_blinken(){ |
| thorb3n | 8:fb6cb712eb52 | 8 | int bremse; |
| thorb3n | 8:fb6cb712eb52 | 9 | bremse = break_value(); // reads break value |
| thorb3n | 8:fb6cb712eb52 | 10 | bremsen=0; |
| thorb3n | 8:fb6cb712eb52 | 11 | while(bremse){ // starts if break value = 1 |
| thorb3n | 8:fb6cb712eb52 | 12 | timer.start(); |
| thorb3n | 8:fb6cb712eb52 | 13 | if(timer.read()>0.5){ // backlight(bremsen) blinks with 1 Hz |
| thorb3n | 8:fb6cb712eb52 | 14 | bremsen=!bremsen; |
| thorb3n | 8:fb6cb712eb52 | 15 | timer.reset(); |
| thorb3n | 8:fb6cb712eb52 | 16 | } |
| thorb3n | 8:fb6cb712eb52 | 17 | } |
| thorb3n | 8:fb6cb712eb52 | 18 | } |
| scooter_project | 9:b1bf6699d610 | 19 | |
| thorb3n | 8:fb6cb712eb52 | 20 | Vorderlicht_steuerung(){ |
| thorb3n | 8:fb6cb712eb52 | 21 | |
| thorb3n | 8:fb6cb712eb52 | 22 | pwm_Licht.period_us(10000); |
| thorb3n | 8:fb6cb712eb52 | 23 | while(1){ |
| thorb3n | 8:fb6cb712eb52 | 24 | pwm_Licht.pulsewidth_us(10000*0.5);// Bluetooth eingabe einfügen |
| thorb3n | 8:fb6cb712eb52 | 25 | } |
| thorb3n | 8:fb6cb712eb52 | 26 | |
| thorb3n | 8:fb6cb712eb52 | 27 | } |