SMART LED strip (NeoPixel) Devlog#3
NeoPixel modes update:
I managed to finish the remaining 3 modes, random mode a.k.a. stars, and two soundbar modes. (Videos are included in the devlog).
I am having some problems with the noise sensor because it seems to not be reacting to normal music, only to extreme loud noises like blowing into the microphone. Also the value in quiet changes every day so I added the calibration function.
WiFi:
I also managed to finish part of the code that connect the ESP32 to the wifi network. I also added a code that synchronizes time. This was quite hard because I used a NTP server which return UTC time. And my country is UTC+1 and we have daylight saving time. But, after about an 1.5 hour I finally managed to find a public API that returns the UTC offset based on the location that it figured out using your IP adress. And it works!
(It took me such a long time because the APIs a have tried before requied HTTPS and my ESP32 didn’t have enougth RAM to manage it)
More detailed project description:
I have written 2 devlogs so far but I think I haven’t described my system enough. So, basically I am building a led strip for my room that will be controled by a display witch touscreen and a simple local web server. (if I don’t run out of RAM on my ESP32). It will have 12 modes and the parameters will be changable via the touchscreen and the web server. I am also planning to integrate a PIR sensor so that it can turn off the strip when I am not in the room (some parameters will be also changable here) and i will add a buzzer because I want it to serve as an alarm clock too. (I hope that light combined with sound will wake me up more easily :) ).
System achitecture:
I will run the neopixel mode functions on the core #2, because I want to make sure that the neopixel animations will run smoothly.
I have written functions to display the color picker UI, numeric keyboard and mode picker, as well as the functions that process thouch during these modes. I am planning to write on big function in which I will process the mode setting UI touch events, and a function that will display the mode setting UI.
Each time someone touches the diplay it triggers an IRQ which sets a flag, after that the touch is assigned to a touch handling function in the main loop.
I will probably use another IRQ for the On/Off button and one for the PIR sensor.
I will also write a function to start and stop running modes on core #2. Also an alarms function.
The web server will run in the main loop and the requests will be handled by a function that the mainloop will call.
Basically the main loop will can funtions and the functions will do something or call other functions. And IRQs will set flags to the main loop.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.