You are reading a single comment by @oesterle and its replies. Click here to read the full conversation.
  • Good thing that things like the Puck object and Puck.light() aren't yet implemented on RuuviTag (right?), since they make assumptions about how on and off are mapped to 1 and 0. One way to mitigate these would be to abstract them:
    LED1.write(ledOn);
    LED1.write(ledOff);
    var buttonState = buttonPressed();

    … where ledOn, ledOff, and buttonPressed() are mapped to 1 or 0 in platform specific ways.

    But those don't solve the problem of running existing Espruino JS apps on RuuviTag. Maybe the IDE could spot things like LED1 and BTN, and in the case of RuuviTag, tag the line with an informational icon (not quite a warning).

    …… answer = 42;
    💡 btnOn = digitalRead(BTN);
    …… console.log(btnOn);

About

Avatar for oesterle @oesterle started