statemachine

Dependencies:   mbed QEI HIDScope biquadFilter MODSERIAL FastPWM

Committer:
boydmartherus
Date:
Fri Sep 20 09:57:41 2019 +0000
Revision:
7:d5e07647dfea
Parent:
6:c2608dedfd70
Child:
9:cdcf30051100
Motor control working

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" ;
boydmartherus 7:d5e07647dfea 4
boydmartherus 7:d5e07647dfea 5 Serial pc(USBTX,USBRX);
boydmartherus 7:d5e07647dfea 6
boydmartherus 7:d5e07647dfea 7 InterruptIn button1(PTC2);
boydmartherus 7:d5e07647dfea 8 InterruptIn button2(PTC3);
boydmartherus 7:d5e07647dfea 9 InterruptIn button3(PTA4);
boydmartherus 7:d5e07647dfea 10 InterruptIn button4(PTC6);
Mortimerz 3:ea5f67f11825 11
Mortimerz 3:ea5f67f11825 12 AnalogIn pot(PTB2);
boydmartherus 6:c2608dedfd70 13
boydmartherus 6:c2608dedfd70 14 FastPWM motor(D5);
MarliesWeggemans 4:3e9a8f5d9a1a 15
Mortimerz 3:ea5f67f11825 16 int main(){
boydmartherus 7:d5e07647dfea 17 printf("Controll with dial\n");
boydmartherus 7:d5e07647dfea 18 while(true){
boydmartherus 7:d5e07647dfea 19 wait(0.1);
boydmartherus 7:d5e07647dfea 20 printf("motor speed is (%f)\n\r",pot.read()); wait(0.1);
boydmartherus 7:d5e07647dfea 21 motor.write(pot);
boydmartherus 7:d5e07647dfea 22 }
boydmartherus 7:d5e07647dfea 23 }