![]() It doesn’t matter if our LEDs are RGB or GRB, we still send the color data as RGB and the library handles the rest. The LED “color” is set using the RGB value, stored in a tuple. Call the pixels object and pass it an instruction to set all of the LEDs as off (0,0,0), then use “show” to see the results. You can determine this from the datasheet / product page where you bought them. ![]() LEDs can be Red, Green, Blue (RGB) or Green, Red, Blue (GRB). Create an object, pixels, and use the NeoPixel library with arguments to set the number of NeoPixels, which GPIO pin it is connected to (GP28) and the format of the LED, in this case GRB. For our example it was 25 in a 5 x 5 matrix. Create a new object, numpix and store inside the object the number of NeoPixels that are in your chain. We pass arguments when creating the object to tell the code which GPIO pins we are using. ![]() Create an object, reader, which will link our code to the RFID reader. We then import the NeoPixel Library before importing libraries to work with random numbers (integers) and for millisecond level control of our code. ![]() The first enables Python to work with the RFID reader. Click on File > New and Create a new file.ġ3.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |