Cool! What kind of speed does it update? Do you have a video?
Not sure, but you might find that the drawImage functionality (with 1 bit graphics) is relatively speedy for stuff like the PacMan icon.
It's a shame the bandwidth is so limited. Speed could definitely be improved if the driver wasn't written in pure JS, but even so it's never going to be amazing.
Was working on getting a video going... don't have the hang on focus yet... ;) ...will get there. Movie is now added.
Regarding the speed: operation is event/timer driven. Operation is basically a continuous repetition of 4 phases:
The phases are optimized for the seamless, timer driven repetition in pairs of two with no logic in them what so over... all logic happens by 'direct' and indirect addressing... (invocation of functions - 1 per phase - stored in an array and called by a cycling index and index for next phase set in the function).
Because of the optimization, a start and stop cycle exist that compensate where needed (for now only the stop):
Each phase sets the next phase index so that on timeout the next function in the cycle is called (indexes in this lists off by 1+):
Since each direction - E, S, W, N - have all their own implementations, they have all their own cycles - but all phases are stored in the same array:
In other words, every cycle's last phase sets the index for the next phase to the first phase of the cycle.
The discussion 'where to draw the line' between high-level (language and device(s) agnostic) and low-level (language and device(s) dependent) application and driver implementation in the hybrid 'over all implementation' may take place in another post...
© Espruino, powered by microcosm.
Report a problem