You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • is there a way to watch multiple pins and determine which one was triggered?

    You'd just have to use setWatch multiple times...

    should I be setting the pinMode myself or will watching the pins just be enough?

    Nope, not unless you need to use the internal pullups (which I doubt?)

    The last "simple" component to test is the light sensor. Does this mean I'm not able to watch the pin for changes? rather would need to setInterval and check the value periodically?

    Yes, it's just software I'm afraid...

    Is there anything that can be done to speed this up?

    Yes... You can use SPI (if it's connected) otherwise the new Espruinos (from have software SPI. Simply doing:

    var S1 = new SPI();
    S1.setup({mosi:DAT, sck:CLK1});
    var S2 = new SPI();
    S2.setup({mosi:DAT, sck:CLK2});
    function writeToDriver(dataOut) {
      digitalWrite(OE, HIGH);
      digitalWrite(LAT, HIGH);
      digitalWrite(LAT, LOW);
      digitalWrite(OE, LOW);
    function writeToRegister(dataOut) {
      S2.send(dataOut, LAT);
      digitalWrite(LAT, LOW);

    would help matters. You'd probably also find that 'inlining' the other functions into updateRow would speed things up a bit too.


Avatar for Gordon @Gordon started