• How do I solve it? What is BTN?

    1 Attachment

    • error.png
  • @user125062,

    the ESP8266 HW / Espruino Firmware build for the ESP8266 HW does not have a button / BTN the way the different Espruino HW / boards have. You have to add externally a button on a GPIO pin that is free / available and code against that pin. Instead of using BTN, you use the GPIO pin identifier.

    If you really want to use BTN, you just make an assignment as first thing in the kind of var BTN = <GPIOPINIdentifier>; (and - for good style - add also setting the pinMode() (see http://www.espruino.com/Reference#l__glo­bal_pinMode).

    For adding external buttons, see: https://www.espruino.com/Pico+Buttons (ESP8266 GPIO Pin may not have a internal pull-up/pull-down feature nor a resistor on the board and connected to the pin you intent to use, therefore you may also have to add a resistor to pull the pin either up or down - depending to which rail you connect the button.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

WebSockets on an Espruino WiFi device for bidirectional communication

Posted by Avatar for user125062 @user125062