Update docs, add upload target to makefile.

This commit is contained in:
Anna Rose 2020-05-13 04:46:20 +00:00
parent 0f54743fa2
commit fcbf9a046a
3 changed files with 15 additions and 9 deletions

View File

@ -1,2 +1,12 @@
BOARD_NAME ?= esp8266:esp8266:huzzah
UPLOAD_PORT ?= /dev/ttyUSB0
.PHONY: all build upload
all: build
build:
arduino-cli compile -b esp8266:esp8266:huzzah smartswitch.ino
arduino-cli compile -b ${BOARD_NAME} smartswitch.ino
upload:
arduino-cli upload -b ${BOARD_NAME} -p ${UPLOAD_PORT} smartswitch.ino

View File

@ -8,14 +8,12 @@
//
// We would expect the webhook to return something like:
//
// 0 1
// 1 0
// 2 1
// [1 0 1]
//
// to activate the momentary switch, (pin 5) deactivate the first
// latched switch, (pin 8) and activate the second latched switch. (pin 10)
const int PIN_MAP[][2] = {
{5, 0},
{5, 1},
{8, 1},
{10, 1}
};

View File

@ -41,12 +41,10 @@ only be high for a short time. 1 is for latched mode; the pin will stay high unt
## Webhook data
The webhook should always return a page in the following format:
The webhook should always return a page in the following (JSON-compatible) format:
```
index_0 state_0
index_1 state_1
...
[state_0, state_1, ...]
```
Where index and state are both integers. If you are expecting momentary input, you should return the