scooter / Mbed 2 deprecated Scooter-uC-Programm

Dependencies:   mbed

Committer:
thorb3n
Date:
Tue Jun 23 10:49:55 2015 +0000
Revision:
12:bad33209d1bb
Parent:
9:b1bf6699d610
update

Who changed what in which revision?

UserRevisionLine numberNew contents of line
thorb3n 8:fb6cb712eb52 1 # include "mbed.h"
thorb3n 8:fb6cb712eb52 2 # include "Prototypen.h"
thorb3n 12:bad33209d1bb 3 PwmOut pwm_Licht(PA_5);// Edit Pin-Port for the frontlight mosfet!!
thorb3n 8:fb6cb712eb52 4 DigitalOut bremsen(PA_6); // Edit Pin-Port for the backlight
thorb3n 12:bad33209d1bb 5 Timer timer1;
scooter_project 9:b1bf6699d610 6
thorb3n 12:bad33209d1bb 7 void 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 12:bad33209d1bb 12 timer1.start();
thorb3n 12:bad33209d1bb 13 if(timer1.read() > 0.5){ // backlight(bremsen) blinks with 1 Hz
thorb3n 8:fb6cb712eb52 14 bremsen=!bremsen;
thorb3n 12:bad33209d1bb 15 timer1.reset();
thorb3n 8:fb6cb712eb52 16 }
thorb3n 8:fb6cb712eb52 17 }
thorb3n 8:fb6cb712eb52 18 }
scooter_project 9:b1bf6699d610 19
thorb3n 12:bad33209d1bb 20 void 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 }