Hello everyone, are you like me preparing for Christmas? I recently learnt how to make a delicate little Christmas tree online, which can be used as a desktop decoration. I was so impressed that I made a quick purchase of some materials and couldn't wait to get started. However, when I powered up the coloued lights, I found that I don't like the color of my Christmas decorations colored lights, it's not as pretty as I thought it would be.
So, I made a light controller that can freely adjust the colors of the colored lights, and make it able to turn off at regular intervals.
When I open the switch, the WS2812 lights up, and the LED's color changes with the color of the colorwheel knob. I can change the colorwheel knob position by touching the screen or rotating the encoder. And when I click the button,the light will be turn off at the setting time .
The MaTouch ESP32 S3 2.1 Rotary TFT with Touch is not compatible with the TFT_eSPI library, so I use the GFX_Library_of_Arduino library instead of the driver.
Since I did not use the TFT_eSPI library, it is needed to delete or comment all the codes related to the TFT_eSPI library.
Initialising the input device,and we need to associate the encoder with the color wheel
To create a group use lv_group_t * g = lv_group_create(), to add an object to the group use lv_group_add_obj(g, obj), and to associate a group with an input device use lv_indev_set_group(indev, g)
Choose the Arduino and enter in parameters. According to the features of MaTouch ESP32 S3 2.1 Rotary TFT with Touch, the resolution is 480*480, the shape is a circle, and the color depth is 16-bit.
Design the screen
Add the colorwheel, switch, and buttons on the interface, the color wheel for getting colors, the switch for light switch, and buttons for timed triggers,and you can modify the parameters of them on the Inspector panel. After that, you can select some other widgets to decorate your interface, all is determined by your preference.