Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Motorsteuerung.cpp@6:7c0a32831a4f, 2015-05-19 (annotated)
- Committer:
- scooter_project
- Date:
- Tue May 19 15:14:50 2015 +0000
- Revision:
- 6:7c0a32831a4f
- Child:
- 8:fb6cb712eb52
motorsteuerung.cpp und prototypen.h erstellt
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
scooter_project | 6:7c0a32831a4f | 1 | #include "mbed.h" |
scooter_project | 6:7c0a32831a4f | 2 | #include "messdatenerfassung.h" |
scooter_project | 6:7c0a32831a4f | 3 | |
scooter_project | 6:7c0a32831a4f | 4 | #define PERIODEN_DAUER 10000 |
scooter_project | 6:7c0a32831a4f | 5 | |
scooter_project | 6:7c0a32831a4f | 6 | |
scooter_project | 6:7c0a32831a4f | 7 | PwmOut mypwm(PWM_OUT); //For output PWM-pin |
scooter_project | 6:7c0a32831a4f | 8 | AnalogIn analog_value0(A0); //For reading Hall-Sensor ADC-PIN |
scooter_project | 6:7c0a32831a4f | 9 | |
scooter_project | 6:7c0a32831a4f | 10 | void motoransteuerung(){ |
scooter_project | 6:7c0a32831a4f | 11 | |
scooter_project | 6:7c0a32831a4f | 12 | mypwm.period_us(PERIODEN_DAUER); // |
scooter_project | 6:7c0a32831a4f | 13 | |
scooter_project | 6:7c0a32831a4f | 14 | while(1) { |
scooter_project | 6:7c0a32831a4f | 15 | mypwm.pulsewidth_us(PERIODEN_DAUER*hall_umrechnung()); //How often to change between High and low per Period. |
scooter_project | 6:7c0a32831a4f | 16 | } |
scooter_project | 6:7c0a32831a4f | 17 | } |