0 votes
in Touch Interface by (120 points)
Hello! I have the Weatherstation Grande Color working well. I would like to add the following functions to the build :

1-  Activate a GPIO pin for 10 seconds at 09, 12, 15, 18, 21 hours every day.

2-   Touch the Moon to activate/deactivate this function. Possibly a red BMP of the Moon when activated?

As an aside, how does one configure the WIFI to grab any open hotspot?

1 Answer

0 votes
by (10.8k points)


It sounds like you have some interesting plans with the Color Kit Grande! Here are some pointers.

  1. Do you know the cron tab syntax? You define a pattern when certain tasks should be executed. I found two libraries which help you to do that, but you'd have to try them yourself: 
  2. This is certainly possible and there are many ways to get this done. This line in the code shows how to read the position where a touch happened: https://github.com/ThingPulse/esp32-weather-station-touch/blob/master/src/main.cpp#L104
    You could check that the touch happened within a certain radius of the center of the moon picture and then activate your function. Coloring the moon picture is also possible, but don't forget that there are 30 different pictures for moon phase (https://github.com/ThingPulse/esp32-weather-station-touch/tree/master/assets/moon) . Maybe it would be easier to draw a red circle around the moon instead of coloring? 
  3. Have a look at the WiFiScan example: https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/examples/WiFiScan/WiFiScan.ino#L42 In line 42 the code checks for open/unencrypted access points. Your code would look similar, first do a scan, then choose a open access point and start a WiFi connection with WiFi.begin(..., ...). This would have to be changed in https://github.com/ThingPulse/esp32-weather-station-touch/blob/master/src/connectivity.h#L11

Welcome to ThingPulse Q&A, where you can ask questions and receive answers from other members of the community.