an SPI interface the cmu pixy camera
Dependents: robotic_fish_ver_4_9_pixy UMO
Diff: pixy.h
- Revision:
- 2:fc86438b206f
- Parent:
- 1:439c7574a5ee
- Child:
- 4:440e747935db
--- a/pixy.h Mon Jun 02 21:30:22 2014 +0000 +++ b/pixy.h Tue Jun 03 15:09:31 2014 +0000 @@ -1,6 +1,7 @@ #pragma once #include "mbed.h" +#define INVALID_BLOCK 20 //a class to aid in SPI communication with the pixy camera //this details the object block format of returned data as described in @@ -25,9 +26,13 @@ short sync; //the block signature. 16 bits short readTwoBytesLSB(); void readNBytes(char* buf, int num); + Block* blocks; //where the blocks are stored + int numBlocks; //amt public: - pixySPI(PinName mosi,PinName miso,PinName sclk, Serial* ser); + pixySPI(PinName mosi,PinName miso,PinName sclk, int nBlocks, Serial* ser); ~pixySPI(); - Block getBlock(Serial* debug); + void capture(); //fills in the blocks pointer char getRawData(); + Block* getBlocks(); + int getNumBlocks(); }; \ No newline at end of file