From fc2ec75a55cb741ada2415bd22df6f57ba090706 Mon Sep 17 00:00:00 2001 From: Matthew Gates Date: Fri, 8 Dec 2017 13:18:30 +0000 Subject: [PATCH] esp compat --- examples/DiscretePot/DiscretePot.ino | 11 +++++++++-- examples/DiscretePot/Makefile.esp | 26 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 examples/DiscretePot/Makefile.esp diff --git a/examples/DiscretePot/DiscretePot.ino b/examples/DiscretePot/DiscretePot.ino index 940c00e..caa7874 100644 --- a/examples/DiscretePot/DiscretePot.ino +++ b/examples/DiscretePot/DiscretePot.ino @@ -13,10 +13,15 @@ DiscretePot PotReversed(AnalogPin); void setup() { Serial.begin(115200); + Serial.println("\n\nsetup() start"); + + // Show we can handle Millis wrap + addMillisOffset(0xFFFFF000); + Pot.begin(0, 10); PotReversed.begin(0, 10, true); delay(300); - Serial.println("setup() complete"); + Serial.println("setup() end"); } void loop() @@ -25,7 +30,9 @@ void loop() PotReversed.update(); if (DoEvery(OutputMs, LastDb)) { - Serial.print("analog value="); + Serial.print("Millis=0x"); + Serial.print(Millis()); + Serial.print(" analog value="); Serial.print(analogRead(AnalogPin)); Serial.print(" Pot.value()="); Serial.print(Pot.value()); diff --git a/examples/DiscretePot/Makefile.esp b/examples/DiscretePot/Makefile.esp new file mode 100644 index 0000000..4078567 --- /dev/null +++ b/examples/DiscretePot/Makefile.esp @@ -0,0 +1,26 @@ +# Compile options +BUILD_EXTRA_FLAGS += -DDEBUG +#BUILD_EXTRA_FLAGS += -DMUTILA_DEBUG +#BUILD_EXTRA_FLAGS += -DDEBUG_OUTPUT=Serial + +# Supported speeds: 921600 460800 230400 115200 57600 9600 +UPLOAD_SPEED = 921600 + +# Set for your hardware +# For NodeMCU 0.9 (ESP-12 Module) (e.g. NodeMCU Amica used in CheeseBoard: Cheddar) +BOARD = nodemcu + +# For NodeMCU 1.0 (ESP-12E Module) +#BOARD = nodemcuv2 + +# For Node32-S (ESP32): +#CHIP = esp32 +#BOARD = node32s + +# For Wemos Lolin 32 +#UPLOAD_SPEED=115200 +#CHIP = esp32 +#BOARD = lolin32 + +include ../esp.mk +