This recipe will demonstrate how to turn individual pixels on the screen on and off. The recipe starts by setting pixels with specific x and y coordinates to indicate on or off. Then, we'll create a simple animation that repeatedly draws pixels in a certain direction, and so creating a line that grows in length. We will place this simple line animation into its own function so that we can call it multiple times and create a type of zigzag line animation.
You will find this recipe useful for when you start controlling the display from your projects and want control over individual pixels. The operation of controlling individual pixels becomes the building block to produce ever more complex drawings.