Library for LinkSprite Y201 JPEG serial camera.
Diff: Y201.cpp
- Revision:
- 9:fbd80a803857
- Parent:
- 5:df71c00b97d8
- Child:
- 10:fd12c96da974
--- a/Y201.cpp Wed Jul 18 11:06:49 2012 +0000 +++ b/Y201.cpp Thu Jul 19 15:48:25 2012 +0000 @@ -1,6 +1,19 @@ #include "Y201.h" #include "rtos.h" +const int Y201::resetSeq [4] = {0x56,0x00,0x26,0x00}; +const int Y201::resetSeqAck [4] = {0x76,0x00,0x26,0x00}; +const int Y201::takePicSeq [5] = {0x56,0x00,0x36,0x01,0x00}; +const int Y201::takePicSeqAck [5] = {0x76,0x00,0x36,0x00,0x00}; +const int Y201::set160x120 [9] = {0x56,0x00,0x31,0x05,0x04,0x01,0x00,0x19,0x22}; +const int Y201::set320x240 [9] = {0x56,0x00,0x31,0x05,0x04,0x01,0x00,0x19,0x11}; +const int Y201::set640x480 [9] = {0x56,0x00,0x31,0x05,0x04,0x01,0x00,0x19,0x00}; +const int Y201::setSizeAck [5] = {0x76,0x00,0x31,0x00,0x00}; +const int Y201::readFileSize [5] = {0x56,0x00,0x34,0x01,0x00}; +const int Y201::readFileSizeAck[7] = {0x76,0x00,0x34,0x00,0x04,0x00,0x00}; +const int Y201::readFileHead [8] = {0x56,0x00,0x32,0x0C,0x00,0x0A,0x00,0x00}; +const int Y201::readFileAck [5] = {0x76,0x00,0x32,0x00,0x00}; + void Y201::trash() { // wait for trash... while(readable()) { @@ -20,7 +33,7 @@ putc(0x0A); // Interval LSB int nread = 0; if(waitFor(readFileAck,readFileAckLen)) { - //Thread::wait(1); + Thread::wait(1); Timer t; t.start(); while(nread<readLen) { @@ -40,7 +53,7 @@ } } } - //Thread::wait(1); + Thread::wait(1); } else { return false; }