scooter / Mbed 2 deprecated Scooter-uC-Programm

Dependencies:   mbed

Committer:
thorb3n
Date:
Tue May 26 12:14:44 2015 +0000
Revision:
8:fb6cb712eb52
Child:
9:b1bf6699d610
beleuchtung

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 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 }