Touchscreen Buttons & Sliders
Hey, I’m back. This time I’m posting my code for getting the hex color values for RGB combos. Mainly, it’s just some experimenting with the touchscreen to create a user interface for the microcontroller. In the past, it was either buttons, pots or rotary encoders and one would have to be crafty to use as little as pins possible for the greatest number of inputs. Now, its just a matter of defining an area with ifs and else ifs and being bounded within the LCD.
The RGB controller uses six buttons and three sliders. Here’s the main file; rgb controller.c. I figure it’ll be useful to define different shades of colors than just the standard RED, BLUE and GREEN. I updated the lcd code with a bar graph function for the slide controls, so you’ll need that;320×240 LCD.c & 320×240 LCD.h. The touchscreen code is the same as before.