• 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:

    1. advance half a cell, draw two lines with small angle
    2. 'undraw' w/ background color what was drawn in previous phase
    3. advance half a cell, draw two lines with wide angle
    4. 'undraw' w/ background color what was drawn in previous phase

    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):

    1. Start cycle - is a phase 1 (or 3) starting from a x/y position compensated by the 'advance half a cell'
    2. Enter repetition mode using a timeout which then executes either phase 2. and 3. or 4. and 1. and calls itself in the next timeout.
    3. Stop cycle - is the phase to remove the last drawing by the undraw, which is either a phase 2. or 4.

    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+):

    1. phase 1 sets index to 2.
    2. phase 2 sets index to 3.
    3. phase 3 sets index to 4.
    4. phase 4 sets index back to 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:

    • E. - 1, 2, 3, 4
    • S. - 5, 6, 7, 8
    • W. - 9, 10, 11, 12
    • N. - 13, 14, 15, 16

    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...


Avatar for Gordon @Gordon started