pixy
Dependencies: mbed
Gimbal_PixyTest.cpp@0:fc7c5285fa79, 2018-10-25 (annotated)
- Committer:
- halusis
- Date:
- Thu Oct 25 03:57:08 2018 +0000
- Revision:
- 0:fc7c5285fa79
for pixy
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
halusis | 0:fc7c5285fa79 | 1 | #include "mbed.h" |
halusis | 0:fc7c5285fa79 | 2 | #include "PinAssign.h" |
halusis | 0:fc7c5285fa79 | 3 | #include "GlobalVariables.h" |
halusis | 0:fc7c5285fa79 | 4 | #include "PixyData.h" |
halusis | 0:fc7c5285fa79 | 5 | |
halusis | 0:fc7c5285fa79 | 6 | Ticker DebugTimer; |
halusis | 0:fc7c5285fa79 | 7 | |
halusis | 0:fc7c5285fa79 | 8 | bool fDebugTimer=0; |
halusis | 0:fc7c5285fa79 | 9 | |
halusis | 0:fc7c5285fa79 | 10 | void DebugTimer_isr(void) |
halusis | 0:fc7c5285fa79 | 11 | { |
halusis | 0:fc7c5285fa79 | 12 | fDebugTimer=1; |
halusis | 0:fc7c5285fa79 | 13 | } |
halusis | 0:fc7c5285fa79 | 14 | |
halusis | 0:fc7c5285fa79 | 15 | int main() |
halusis | 0:fc7c5285fa79 | 16 | { |
halusis | 0:fc7c5285fa79 | 17 | pc.baud(115200); |
halusis | 0:fc7c5285fa79 | 18 | pixy.baud(115200); |
halusis | 0:fc7c5285fa79 | 19 | |
halusis | 0:fc7c5285fa79 | 20 | DebugTimer.attach(&DebugTimer_isr,0.5); |
halusis | 0:fc7c5285fa79 | 21 | |
halusis | 0:fc7c5285fa79 | 22 | pc.printf("Start\n"); |
halusis | 0:fc7c5285fa79 | 23 | while(1) |
halusis | 0:fc7c5285fa79 | 24 | { |
halusis | 0:fc7c5285fa79 | 25 | //if(pc.readable()) pixy.putc(pc.getc()); |
halusis | 0:fc7c5285fa79 | 26 | //if(pixy.readable()) pc.putc(pixy.getc()); |
halusis | 0:fc7c5285fa79 | 27 | |
halusis | 0:fc7c5285fa79 | 28 | if(pixy.readable()) PixyData(); |
halusis | 0:fc7c5285fa79 | 29 | if(fDebugTimer==1) |
halusis | 0:fc7c5285fa79 | 30 | { |
halusis | 0:fc7c5285fa79 | 31 | // pc.printf("sigN:%d xObs:%d yObs:%d widthObs:%d heightObs:%d\n",PixyChks, SigNum, XObs, YObs, WidObs, HeiObs); |
halusis | 0:fc7c5285fa79 | 32 | fDebugTimer=0; |
halusis | 0:fc7c5285fa79 | 33 | } |
halusis | 0:fc7c5285fa79 | 34 | } |
halusis | 0:fc7c5285fa79 | 35 | } |