statemachine

Dependencies:   mbed QEI HIDScope biquadFilter MODSERIAL FastPWM

Committer:
Mortimerz
Date:
Fri Sep 20 07:22:47 2019 +0000
Revision:
3:ea5f67f11825
Parent:
2:38ec7638236e
Child:
4:3e9a8f5d9a1a
t

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
Mortimerz 3:ea5f67f11825 5 InterruptIn button1(PTC2);
Mortimerz 3:ea5f67f11825 6 InterruptIn button2(PTC3);
Mortimerz 3:ea5f67f11825 7 AnalogIn pot(PTB2);
Mortimerz 3:ea5f67f11825 8 Serial pc(USBTX,USBRX);
Mortimerz 3:ea5f67f11825 9 FastPWM led(PTA2);
Mortimerz 3:ea5f67f11825 10 InterruptIn button3(PTA4);
Mortimerz 3:ea5f67f11825 11 InterruptIn button4(PTC6);
Mortimerz 3:ea5f67f11825 12
Mortimerz 3:ea5f67f11825 13 float ledb = 0.5f;
Mortimerz 3:ea5f67f11825 14
Mortimerz 3:ea5f67f11825 15 int main(){
Mortimerz 3:ea5f67f11825 16 printf("Controll with dial\n");
Mortimerz 3:ea5f67f11825 17 led.period(0.01f) ;
Mortimerz 3:ea5f67f11825 18 led.write(0.5f) ;
Mortimerz 3:ea5f67f11825 19 while(true){
Mortimerz 3:ea5f67f11825 20 wait(0.01);
Mortimerz 3:ea5f67f11825 21 printf("analog input is (%f)\n\r",pot.read()); wait(0.1);
Mortimerz 3:ea5f67f11825 22 led.write(pot);
Mortimerz 3:ea5f67f11825 23 }
RobertoO 0:67c50348f842 24 }