This project will connect your controller to wifi, and connect to an Express server running on your computer,
- You will need a supported ESP8266 microcontroller. Preconfigured boards, thus far, are:
- Your hardware should be flashed with ThingsSDK Flasher.js using the latest Espruino JS runtime.
- You should have ThingsSDK-cli installed.
- Other accessories: breadboard, wires, at least one button.
On a breadboard, connect 3v and ground to the appropriate rails, then connect ground to button, then button to a GPIO pin (except pin 15 on Feather Huzzah, which has a built-in pulldown resistor and needs to be wired to the 3v rail).
clone this repo, edit the skeleton.config.js to add your local environment information, then run the following:
npm i npm run configure thingssdk devices npm run push
In another terminal, run node api
to start the Express Server.
Now, press a button!
- if you add
debounce
to the options object passed tosetWatch
, thee
object passed to the handler function no longer contains thepin
property.
- debouncing issues with pins other than 15 on Feather Huzzah. One press can get you multiple API calls.