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.
On a breadboard, connect 3v and ground to the rails, then wire ground to button to pin (except pin 15 on Feather Huzzah, which has a built-in pulldown resistor and needs to be wired to 3v rail).
clone this repo, edit the skeleton.config.js to add your local environment information, then run the following:
npm i npm run projectInit 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.