Laser Sensing Display for UI interfaces in the real world
Fork of skinGames_forktest by
Diff: main.cpp
- Revision:
- 18:d72935b13858
- Parent:
- 17:356ca5690a59
- Child:
- 19:228430f1350e
--- a/main.cpp Sat Apr 28 09:33:49 2012 +0000 +++ b/main.cpp Sat Apr 28 12:35:21 2012 +0000 @@ -60,7 +60,7 @@ // Timers: Timer measureLoopPeriod; //Timer measureUpdatePeriod; -Timer measureSendPeriod; + // to get serial commands (not necessary perhaps) void processSerial(); @@ -140,7 +140,6 @@ #endif //measureUpdatePeriod.start(); - measureSendPeriod.start(); while (true) { @@ -157,6 +156,14 @@ // draw the config (note: each kind of blob renders differently) blobconf.draw(); + + + // (b)Sending Data: // PUT THIS IN AN INTERRUPT OR USE A TIMER!!! it may be TOO FAST... + // NOTE: better use a timer, so the only ISR "ticker" is the laser rendering (otherwise the laser rendering will be interrupted by the sending of data - the other way is ok): + // NOTE: timer for sending is now not COMMON to all blobs, but depends on the blob (it could depend on the CONFIG only, but this can be simulated by using + // per blob timer counter. + blobconf.sendConfData(); + lsr.startFullDisplay(); // this start the point-display counter (wherever the actual laser is). Before update and draw, the counter needs to be reset. @@ -179,20 +186,6 @@ #endif - // (b)Sending Data: // PUT THIS IN AN INTERRUPT OR USE A TIMER!!! it may be TOO FAST... - // NOTE: better use a timer, so the only ISR "ticker" is the laser rendering (otherwise the laser rendering will be interrupted by the sending of data - the other way is ok): - - - if (measureSendPeriod.read_ms()>25) { - measureSendPeriod.stop(); - measureSendPeriod.reset(); - - blobconf.sendConfData(); - - measureSendPeriod.start(); - } - - // text: /* sendMes.setTopAddress("/hello");