Update docs, add upload target to makefile.
This commit is contained in:
parent
0f54743fa2
commit
fcbf9a046a
12
Makefile
12
Makefile
|
@ -1,2 +1,12 @@
|
||||||
|
BOARD_NAME ?= esp8266:esp8266:huzzah
|
||||||
|
UPLOAD_PORT ?= /dev/ttyUSB0
|
||||||
|
|
||||||
|
.PHONY: all build upload
|
||||||
|
|
||||||
|
all: build
|
||||||
|
|
||||||
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
|
||||||
|
|
|
@ -8,14 +8,12 @@
|
||||||
//
|
//
|
||||||
// We would expect the webhook to return something like:
|
// We would expect the webhook to return something like:
|
||||||
//
|
//
|
||||||
// 0 1
|
// [1 0 1]
|
||||||
// 1 0
|
|
||||||
// 2 1
|
|
||||||
//
|
//
|
||||||
// to activate the momentary switch, (pin 5) deactivate the first
|
// to activate the momentary switch, (pin 5) deactivate the first
|
||||||
// latched switch, (pin 8) and activate the second latched switch. (pin 10)
|
// latched switch, (pin 8) and activate the second latched switch. (pin 10)
|
||||||
const int PIN_MAP[][2] = {
|
const int PIN_MAP[][2] = {
|
||||||
{5, 0},
|
{5, 1},
|
||||||
{8, 1},
|
{8, 1},
|
||||||
{10, 1}
|
{10, 1}
|
||||||
};
|
};
|
||||||
|
|
|
@ -41,12 +41,10 @@ only be high for a short time. 1 is for latched mode; the pin will stay high unt
|
||||||
|
|
||||||
|
|
||||||
## Webhook data
|
## 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
|
[state_0, state_1, ...]
|
||||||
index_1 state_1
|
|
||||||
...
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Where index and state are both integers. If you are expecting momentary input, you should return the
|
Where index and state are both integers. If you are expecting momentary input, you should return the
|
||||||
|
|
Loading…
Reference in New Issue
Block a user