scooter / Mbed 2 deprecated Scooter-uC-Programm

Dependencies:   mbed

Committer:
thorb3n
Date:
Tue Jun 23 10:49:55 2015 +0000
Revision:
12:bad33209d1bb
Parent:
11:7dfdb8074992
Child:
13:565aa2c6bd3d
update

Who changed what in which revision?

UserRevisionLine numberNew contents of line
scooter_project 6:7c0a32831a4f 1 #include "mbed.h"
thorb3n 8:fb6cb712eb52 2 #include "Prototypen.h"
scooter_project 6:7c0a32831a4f 3
scooter_project 6:7c0a32831a4f 4
scooter_project 6:7c0a32831a4f 5 PwmOut mypwm(PWM_OUT); //For output PWM-pin
thorb3n 11:7dfdb8074992 6 AnalogIn analog_value0(A0); //For reading Hall-Sensor ADC-PIN
thorb3n 11:7dfdb8074992 7
thorb3n 12:bad33209d1bb 8 void motoransteuerung(){
thorb3n 12:bad33209d1bb 9 mypwm.period_us(PERIODEN_DAUER);
scooter_project 6:7c0a32831a4f 10 while(1) {
thorb3n 11:7dfdb8074992 11 if(break_value==0) {
thorb3n 11:7dfdb8074992 12 mypwm.pulsewidth_us(PERIODEN_DAUER*hall_umrechnung()); //How often to change between High and low per Period.
thorb3n 12:bad33209d1bb 13 }
thorb3n 11:7dfdb8074992 14 }
scooter_project 6:7c0a32831a4f 15 }