scooter / Mbed 2 deprecated Scooter-uC-Programm

Dependencies:   mbed

Motorsteuerung.cpp

Committer:
scooter_project
Date:
2015-05-26
Revision:
9:b1bf6699d610
Parent:
8:fb6cb712eb52
Child:
11:7dfdb8074992

File content as of revision 9:b1bf6699d610:

#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) {
        mypwm.pulsewidth_us(PERIODEN_DAUER*hall_umrechnung()); //How often to change between High and low per Period.
    }
}