![](/media/cache/profiles/altb_JGUSAOG.jpg.50x50_q85.jpg)
SPI read Pixi Cam V1
main.cpp@4:478d4d9193a1, 2021-08-23 (annotated)
- Committer:
- altb2
- Date:
- Mon Aug 23 11:26:37 2021 +0000
- Revision:
- 4:478d4d9193a1
- Child:
- 5:d109b094d4bb
1st commit, reading pixi cam via SPI
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
altb2 | 4:478d4d9193a1 | 1 | #include "mbed.h" |
altb2 | 4:478d4d9193a1 | 2 | #include "pixySPI.h" |
altb2 | 4:478d4d9193a1 | 3 | //SPI spi(PC_12, PC_11, PC_10); |
altb2 | 4:478d4d9193a1 | 4 | pixySPI pixy(PC_12, PC_11, PC_10,10); |
altb2 | 4:478d4d9193a1 | 5 | static BufferedSerial serial_port(USBTX, USBRX,115200); |
altb2 | 4:478d4d9193a1 | 6 | int main(void) |
altb2 | 4:478d4d9193a1 | 7 | { |
altb2 | 4:478d4d9193a1 | 8 | printf("Start\r\n"); |
altb2 | 4:478d4d9193a1 | 9 | while(1) |
altb2 | 4:478d4d9193a1 | 10 | { |
altb2 | 4:478d4d9193a1 | 11 | ThisThread::sleep_for(200); |
altb2 | 4:478d4d9193a1 | 12 | pixy.capture(); |
altb2 | 4:478d4d9193a1 | 13 | ThisThread::sleep_for(200); |
altb2 | 4:478d4d9193a1 | 14 | printf("NumBlocks: %d\r\n",pixy.getNumBlocks()); |
altb2 | 4:478d4d9193a1 | 15 | } |
altb2 | 4:478d4d9193a1 | 16 | //pixy.blocks[0].printBlock(); |
altb2 | 4:478d4d9193a1 | 17 | } |