Opzetje
Dependencies: mbed QEI HIDScope biquadFilter MODSERIAL FastPWM
main.cpp@6:3930811edddf, 2019-09-23 (annotated)
- Committer:
- boydmartherus
- Date:
- Mon Sep 23 13:56:11 2019 +0000
- Revision:
- 6:3930811edddf
- Parent:
- 4:86872b89b21c
- Child:
- 7:2f612f32711a
motor + ticeker
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
RobertoO | 0:67c50348f842 | 1 | #include "mbed.h" |
boydmartherus | 6:3930811edddf | 2 | #include "MODSERIAL.h" |
boydmartherus | 6:3930811edddf | 3 | #include "FastPWM.h" |
Mortimerz | 3:ea5f67f11825 | 4 | |
boydmartherus | 4:86872b89b21c | 5 | Serial pc(USBTX,USBRX); |
boydmartherus | 4:86872b89b21c | 6 | |
Mortimerz | 3:ea5f67f11825 | 7 | InterruptIn button1(PTC2); |
Mortimerz | 3:ea5f67f11825 | 8 | InterruptIn button2(PTC3); |
Mortimerz | 3:ea5f67f11825 | 9 | InterruptIn button3(PTA4); |
Mortimerz | 3:ea5f67f11825 | 10 | InterruptIn button4(PTC6); |
Mortimerz | 3:ea5f67f11825 | 11 | |
boydmartherus | 4:86872b89b21c | 12 | AnalogIn pot(PTB2); |
boydmartherus | 4:86872b89b21c | 13 | |
boydmartherus | 4:86872b89b21c | 14 | FastPWM motor(D5); |
Mortimerz | 3:ea5f67f11825 | 15 | |
boydmartherus | 6:3930811edddf | 16 | Ticker ticker; |
boydmartherus | 6:3930811edddf | 17 | |
boydmartherus | 6:3930811edddf | 18 | void motor_speed() |
boydmartherus | 6:3930811edddf | 19 | { |
boydmartherus | 6:3930811edddf | 20 | motor.write(pot); |
boydmartherus | 6:3930811edddf | 21 | } |
boydmartherus | 6:3930811edddf | 22 | |
boydmartherus | 6:3930811edddf | 23 | int main() |
boydmartherus | 6:3930811edddf | 24 | { |
boydmartherus | 6:3930811edddf | 25 | ticker.attach(&motor_speed, 0.001f); |
boydmartherus | 6:3930811edddf | 26 | while(true){}; |
boydmartherus | 6:3930811edddf | 27 | } |