• Are you reusing m once as a method/function name in line 38 [30] for 16 [8] bit expander, but overwrite it in the constructor - which happens 'after' definition of the prototype and therefore acts as an overwriting per instance with the number 65535 (0xFFFF) [255 (0xFF)] in line 16 for both 16 [and 8] bit expander? May be you wanted to call the m in the constructor mask?

    This issue completely explains what's going on: after construction the object's prototype does not matter anymore, because the constructor assigns an m for the instance...

    PS: Sorry that I could not be of more help, even though I ordered two expanders a while ago and they are sitting idle now already for more than - I guess - a month. Initially, I had planned to use them for some ueber-sized 7-segment LCD displays in the props of a children's musical with time travel... but ended up with a 'cheapo solution': large tv and a html page with add/remove css classes to lite and un-lite the segments. At first, I wanted to use SVG (scalable vector graphics), but ended up with simple table tag for the production... for time reasons (shame on me... but for redemption, I did it afterwards with vector graphics and it looks much nicer...) .

    The html with embedded javascript code was intended for functional development with simple debugging (...last but not least also to move ahead while waiting for the expanders to arrive). The timesDisplay.html was running as a pop-up driven by a Controller Web application using var win = window.open(url,...) and sending commands to the display objects in the pop-up using win[nowDisplay].print(2015);

    For production, the display would run by a Wifi connected and HTTP server running Espruino Pico, and the driver Web app would make CORS AJAX calls...

    All a bit ambitious and too much a stretch for the available build time frame (and also 'complicated'...). In the end, multiple laptops ran the show with fullscreen popups on large external second screens... controlled by stage hands behind the scene... (:

    Attached timesDisplayHTML.html file is standalone - click on it to see it running. Providing a scaling factor from 0.05 .. 1.0 as search string in the url (...?1.0) allowed adaption to the different displays used in the production. Clicking into the screen makes it fullscreen. As mentioned above, the SVG redemption was not just a 7-segment but a 17-segment display. Clicking in the display shows it scrambling.


    4 Attachments

About

Avatar for allObjects @allObjects started