Opzetje

Dependencies:   mbed QEI HIDScope biquadFilter MODSERIAL FastPWM

Committer:
boydmartherus
Date:
Fri Sep 20 09:32:39 2019 +0000
Revision:
4:86872b89b21c
Parent:
3:ea5f67f11825
Child:
5:9f097dde857f
Child:
6:3930811edddf
motor control werkend

Who changed what in which revision?

UserRevisionLine numberNew contents of line
RobertoO 0:67c50348f842 1 #include "mbed.h"
Mortimerz 3:ea5f67f11825 2 #include "MODSERIAL.h";
Mortimerz 3:ea5f67f11825 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
Mortimerz 3:ea5f67f11825 16 int main(){
Mortimerz 3:ea5f67f11825 17 printf("Controll with dial\n");
Mortimerz 3:ea5f67f11825 18 while(true){
boydmartherus 4:86872b89b21c 19 wait(0.1);
boydmartherus 4:86872b89b21c 20 printf("motor speed is (%f)\n\r",pot.read()); wait(0.1);
boydmartherus 4:86872b89b21c 21 motor.write(pot);
Mortimerz 3:ea5f67f11825 22 }
RobertoO 0:67c50348f842 23 }