SensorsIot / Reminder-with-Google-Calender

Reminder connects an ESP8266 to a Google Calender
46 stars 17 forks source link

Improved version #2

Open witchole opened 6 years ago

witchole commented 6 years ago

Attached version of Reminder_Analog has the following improvements:

https://github.com/electronicsguy/ESP8266/tree/master/HTTPSRedirect

(when user presses a button to create a new task, but before the task has been created in GCal).

This new status makes the code simpler in manageStatus().

This is useful to save writing unnecessarily, for example in the common situation where someone presses a button to activate a task, then immediately presses again to cancel (either when demonstrating the device, or to correct a mistake).

Without the delay will result in 2 (wasted) write-cycles, whereas with the delay there will be no write at all.

(previous version did not respond in this situation).

(useful to illustrate leaking memory problem with v2.4.1 of the ESP8266 library)

(distracting otherwise when no tasks are currently due).

(I don't use D4 for that reason).

Future enhancement:

It would be nice to do away with the current polling solution using a Ticker object. Is it possible to use a proper hardware interrupt to signal when to read the analog pin (A0) - e.g. by connecting the switches to another input pin as well as A0?

At the moment, if someone presses a button while the calendar is being accessed, there can be a delay before the LED status changes, and the key press is occasionally not registered at all.

Reminder_AnalogV2.zip

kodacy commented 6 years ago

I'm trying to assemble the Reminder V2 with 4 bottoms but from the video it is not very clear the full billd schematic (how the interrupts and leds connect to the Wemos D1 Mini Pin by pin). Can anyone help with a full build schematic? Thank you very much in advance.

witchole commented 6 years ago

Hi kodacy, I don't have a schematic, but the circuit is very simple.

Switches:

LEDs:

edit: That is for the "analog" version, that can have up to 8 switches. If you're building the version with proper interrupts, simply wire up each switch between GND and whatever GPIO pin you specify in the source code.

SensorsIot commented 4 years ago

I just compiled ReminderV2 and ReminderAnalog with IDE 1.8.12 and ESP8266 2.6.3 on Windows10 and did not get errors

kodacy commented 4 years ago

Will try again tonight, and will feedback.

kodacy commented 4 years ago

Sorry for talking so long to reply, but still no luck: using Windows 10 IDE 1.8.13 and ESP8266 2.6.3 on Windows10

Always getting:

Reminder_Analog.ino: In function 'void setup()': Reminder_Analog:289:11: error: 'D0' was not declared in this scope pinMode(D0, OUTPUT); ^ exit status 1 'D0' was not declared in this scope

witchole commented 4 years ago

Reminder_Analog.ino: In function 'void setup()': Reminder_Analog:289:11: error: 'D0' was not declared in this scope

Hi @kodacy, this page is for Reminder_AnalogV2.ino, not Reminder_Analog.ino.

D0 is defined in pins_arduino.h