Setting up the NeoPixel LED
In this section, we will interface and test a NeoPixel LED. We are adding an LED to the project because it could be used as a visual aid to let you know if your soil is too dry. If you are not familiar with NeoPixel LEDs, these are individually addressable RGB LEDs. You can find more information about them here: https://bit.ly/3sin0x5.
The NeoPixel is connected to GP0, as shown in Figure 4.7. The connections between the Pico and the NeoPixel are listed as follows:
- GP0 → In pin of NeoPixel.
- VBUS → + pin.
- The GND pins are tied together.
An interface diagram is shown here:
Now, let's test if everything is in working order. The first step is to import the requisite modules, as follows:
import time import board import neopixel
Now, let's initialize an object belonging to the Neopixel
class by running the following code:
pixel_pin...