Diff: PlayerBase.h
- Revision:
- 1:578d6bbe9f09
- Parent:
- 0:01be2d5eaf72
- Child:
- 2:ce4c7e5ab241
--- a/PlayerBase.h Mon Oct 31 02:34:13 2011 +0000 +++ b/PlayerBase.h Fri Dec 16 07:14:05 2011 +0000 @@ -9,11 +9,23 @@ { public: PlayerBase(); - virtual void setGalvo(uint16_t x, uint16_t y); virtual void setLaserPower(uint16_t power); - virtual void wait(uint16_t us); + virtual void wait(uint16_t ms); + + // this is for scanning to calibrate camera. + virtual void calibrationScan() {}; + virtual void point(uint16_t x, uint16_t y) {}; + // this is for color scanning + virtual void readRgb() {}; + virtual void setLaserPowerRgb(uint8_t red, uint8_t green, uint8_t blue) {}; + + virtual void ready() {}; + virtual void areYouThere() {}; + virtual void message(int aLevel, int aLength, char *aString) {}; + + inline void penDown() { mPenDown = true; setLaserPower(mLaserPower); @@ -31,6 +43,9 @@ bool hasNext(); bool playOne(); + uint16_t getX() { return mGalvoX; }; + uint16_t getY() { return mGalvoY; }; + protected: void rasterLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, int step=1); @@ -43,10 +58,9 @@ return mData[mPlayHead-1]; } + // TODO(dps): take care of endian inline uint16_t decodeU16() { uint16_t i; - // i = (((uint16_t)get()) << 8) + get(); - // mbed i = (uint16_t)get() << 8; i |= (uint16_t)get(); return i;