As used for motor testing May / June 2016
Dependencies: iC_MU mbed-rtos mbed
Fork of SweptSine by
Diff: Pan_Feedback.cpp
- Revision:
- 3:463edcfc09c5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Pan_Feedback.cpp Wed Jun 08 13:56:25 2016 +0000 @@ -0,0 +1,36 @@ +#include "mbed.h" +#include "rtos.h" + +float Pan_count = 1000; + +InterruptIn pan_pulser(p30); // Pulse counter for Pan axis in this case 10 counts per rev. NOTE!! this has to be 3.3V, + +void func_fall(void) +{ + // pc.printf("fall.\n\r"); + //Pan_count = Pan_count -1000; + if (Pan_count > 0) { + Pan_count = 0; + } else { + Pan_count = 1000; + } +} +void func_rise(void) +{ + //pc.printf("rise.\n\r"); + //Pan_count = Pan_count +1000; + if (Pan_count > 0) { + Pan_count = 0; + } else { + Pan_count = 1000; + } +} + +void Pan_Counter(void const *args) +{ + pan_pulser.fall(&func_fall); + pan_pulser.rise(&func_rise); +} + + +