Port of Arduino Pixy Cmucam5 library.
Fork of pixy by
Revision 1:6ab45d67f36d, committed 2018-03-23
- Comitter:
- vermaelen
- Date:
- Fri Mar 23 15:47:32 2018 +0000
- Parent:
- 0:ed8dc4531ac1
- Commit message:
- good
Changed in this revision
Pixy.cpp | Show annotated file Show diff for this revision Revisions of this file |
Pixy.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r ed8dc4531ac1 -r 6ab45d67f36d Pixy.cpp --- a/Pixy.cpp Sun Nov 16 11:52:55 2014 +0000 +++ b/Pixy.cpp Fri Mar 23 15:47:32 2018 +0000 @@ -20,6 +20,15 @@ blocks = new Block[blockArraySize]; } +Pixy::Pixy(PinName tx, PinName rx) +{ + m_link = new PixyLinkUART(tx,rx); + skipStart = false; + blockCount = 0; + blockArraySize = PIXY_INITIAL_ARRAYSIZE; + blocks = new Block[blockArraySize]; +} + Pixy::~Pixy() { delete[] blocks; @@ -62,7 +71,7 @@ if (checksum == sum) blockCount++; else if (pc) - pc->printf("cs error\n\r"); + //c->printf("cs error\n\r"); w = m_link->getWord(); if (w != PIXY_START_WORD) @@ -107,7 +116,7 @@ return true; else if (w == PIXY_START_WORDX) { if (pc) - pc->printf("reorder\n\r"); + // pc->printf("reorder\n\r"); m_link->getByte(); // resync } lastw = w;
diff -r ed8dc4531ac1 -r 6ab45d67f36d Pixy.h --- a/Pixy.h Sun Nov 16 11:52:55 2014 +0000 +++ b/Pixy.h Fri Mar 23 15:47:32 2018 +0000 @@ -22,6 +22,7 @@ public: enum LinkType {SPI, I2C, UART}; Pixy(LinkType linkType, PinName mosi_sda_tx, PinName miso_scl_rx, PinName sclk = NC); + Pixy(PinName tx, PinName rx); ~Pixy(); uint16_t getBlocks(uint16_t maxBlocks=1000); int8_t setServos(uint16_t s0, uint16_t s1);