fancy lampje

Dependencies:   mbed QEI HIDScope biquadFilter MODSERIAL FXOS8700Q FastPWM

Committer:
MatthewMaat
Date:
Fri Sep 20 10:12:16 2019 +0000
Revision:
11:de4a85703169
Parent:
10:e1eb73e19540
Child:
12:7f280a661e71
pwm test 4

Who changed what in which revision?

UserRevisionLine numberNew contents of line
RobertoO 0:67c50348f842 1 #include "mbed.h"
MatthewMaat 11:de4a85703169 2 //#include "HIDScope.h"
MatthewMaat 11:de4a85703169 3 //#include "QEI.h"
RobertoO 1:b862262a9d14 4 #include "MODSERIAL.h"
RobertoO 0:67c50348f842 5 //#include "BiQuad.h"
MatthewMaat 8:ec3c634390c7 6 #include "FastPWM.h"
MatthewMaat 2:626688c21b6f 7 #include <iostream>
MatthewMaat 5:cee5f898b350 8 MODSERIAL pc(USBTX, USBRX);
MatthewMaat 11:de4a85703169 9 PwmOut pout(A5);
MatthewMaat 10:e1eb73e19540 10 AnalogIn ain(A0);
MatthewMaat 11:de4a85703169 11
MatthewMaat 11:de4a85703169 12
MatthewMaat 11:de4a85703169 13 Ticker Theticker;
MatthewMaat 11:de4a85703169 14 volatile char c='x';
MatthewMaat 11:de4a85703169 15 volatile int color=0;
MatthewMaat 10:e1eb73e19540 16
MatthewMaat 11:de4a85703169 17 void Take_Measurement(void)
MatthewMaat 11:de4a85703169 18 {
MatthewMaat 11:de4a85703169 19 pc.printf("%f",ain*100.0f);
MatthewMaat 11:de4a85703169 20 }
MatthewMaat 11:de4a85703169 21
MatthewMaat 8:ec3c634390c7 22 int main()
MatthewMaat 4:f988679bf9a1 23 {
MatthewMaat 11:de4a85703169 24 Theticker.attach(Take_Measurement,0.5);
MatthewMaat 11:de4a85703169 25 pc.baud(115200);
MatthewMaat 11:de4a85703169 26 pout.write(0.5);
MatthewMaat 11:de4a85703169 27
MatthewMaat 8:ec3c634390c7 28 while (true) {
MatthewMaat 11:de4a85703169 29 wait_ms(500);
MatthewMaat 4:f988679bf9a1 30 }
MatthewMaat 4:f988679bf9a1 31 }