scooter / Mbed 2 deprecated Scooter-uC-Programm

Dependencies:   mbed

Beleuchtungssteuerung.cpp

Committer:
thorb3n
Date:
2015-06-23
Revision:
12:bad33209d1bb
Parent:
9:b1bf6699d610

File content as of revision 12:bad33209d1bb:

# include "mbed.h"
# include "Prototypen.h"
PwmOut pwm_Licht(PA_5);// Edit Pin-Port for the frontlight mosfet!!
DigitalOut bremsen(PA_6); // Edit Pin-Port for the backlight 
Timer timer1;

void Bremse_blinken(){
    int bremse;
    bremse = break_value(); // reads break value
    bremsen=0;
    while(bremse){  // starts if break value = 1
        timer1.start();
        if(timer1.read() > 0.5){   // backlight(bremsen) blinks with 1 Hz
            bremsen=!bremsen;
            timer1.reset();
            }
        }
    }
    
void Vorderlicht_steuerung(){
    
    pwm_Licht.period_us(10000);
    while(1){
        pwm_Licht.pulsewidth_us(10000*0.5);// Bluetooth eingabe einfügen
        }
    
    }