We use the touch LCD before as well, but it has more functions than the bumper switch, and that means it has more commands we can explore. This program should look familiar as we did similar things with a touch led already. The program changes the LED color depending on whether it's touched or not. The new command we're learning here isn't about the touch LED, it's about the brain screen. The command display centered big text line has two parameters. The line on which it will write and the text it will write between the quotation marks.
The lines on the brain screen work like this, and this program will write the words touch or no touch in big letters in the middle of the screen. We can also blink the touch led With a set touch LED blink time command, it has three parameters. First is the device itself. Remember that you might have more than one touch LED, and here you will specify which one to blink. The second is the on time and the third the off time. Strangely, the set touch LED blink time on and off parameters are in 50 millisecond increments.
Therefore 20 will mean one second. In this example, the LED will be on for two seconds and off for half a second. Setting the on and off time to zero we'll disable the blinking mode. We can set the touch led brightness with the set touch led brightness command. The command has two parameters For the first parameter we get to choose which led again, and the second parameter allows us to change the LED brightness between zero which is off, and 255, which is full brightness or 100% brightness. If you don't like sudden changes in color, you can use the same touch led fade command, which will smoothly fade the LED between different colors.
The parameters work the same as before, specify the LED to use and set the time to spend on finding from one color to the next. Note that the touch led must already be on for this to work and setting the fade setting to color fade none will disable the fade feature