scooter / Mbed 2 deprecated Scooter-uC-Programm

Dependencies:   mbed

Motorsteuerung.cpp

Committer:
thorb3n
Date:
2015-06-23
Revision:
12:bad33209d1bb
Parent:
11:7dfdb8074992
Child:
13:565aa2c6bd3d

File content as of revision 12:bad33209d1bb:

#include "mbed.h"
#include "Prototypen.h"


PwmOut mypwm(PWM_OUT);      //For output PWM-pin
AnalogIn analog_value0(A0); //For reading Hall-Sensor ADC-PIN

void motoransteuerung(){
    mypwm.period_us(PERIODEN_DAUER); 
    while(1) {
        if(break_value==0) {
            mypwm.pulsewidth_us(PERIODEN_DAUER*hall_umrechnung()); //How often to change between High and low per Period.
            }
        }
    }