statemachine
Dependencies: mbed QEI HIDScope biquadFilter MODSERIAL FastPWM
main.cpp@4:3e9a8f5d9a1a, 2019-09-20 (annotated)
- Committer:
- MarliesWeggemans
- Date:
- Fri Sep 20 08:35:52 2019 +0000
- Revision:
- 4:3e9a8f5d9a1a
- Parent:
- 3:ea5f67f11825
- Child:
- 5:9ebcbd39ec3f
lampjebranden werkend
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
RobertoO | 0:67c50348f842 | 1 | #include "mbed.h" |
Mortimerz | 3:ea5f67f11825 | 2 | #include "MODSERIAL.h"; |
Mortimerz | 3:ea5f67f11825 | 3 | #include "FastPWM.h" ; |
MarliesWeggemans | 4:3e9a8f5d9a1a | 4 | #include "QEI.h"; |
Mortimerz | 3:ea5f67f11825 | 5 | |
Mortimerz | 3:ea5f67f11825 | 6 | AnalogIn pot(PTB2); |
Mortimerz | 3:ea5f67f11825 | 7 | Serial pc(USBTX,USBRX); |
Mortimerz | 3:ea5f67f11825 | 8 | FastPWM led(PTA2); |
MarliesWeggemans | 4:3e9a8f5d9a1a | 9 | |
Mortimerz | 3:ea5f67f11825 | 10 | |
Mortimerz | 3:ea5f67f11825 | 11 | float ledb = 0.5f; |
Mortimerz | 3:ea5f67f11825 | 12 | int main(){ |
Mortimerz | 3:ea5f67f11825 | 13 | printf("Controll with dial\n"); |
Mortimerz | 3:ea5f67f11825 | 14 | led.period(0.01f) ; |
Mortimerz | 3:ea5f67f11825 | 15 | led.write(0.5f) ; |
Mortimerz | 3:ea5f67f11825 | 16 | while(true){ |
Mortimerz | 3:ea5f67f11825 | 17 | wait(0.01); |
MarliesWeggemans | 4:3e9a8f5d9a1a | 18 | pc.printf("analog input is (%f)\n\r",pot.read()); wait(0.1); |
Mortimerz | 3:ea5f67f11825 | 19 | led.write(pot); |
Mortimerz | 3:ea5f67f11825 | 20 | } |
RobertoO | 0:67c50348f842 | 21 | } |