I want to change Raspberry Pi code about neopixel in Python

86 views Asked by At
import board
import neopixel

pixels = neopixel.NeoPixel(board.D18, 144)

for i in range(0, 144):
    pixels[i] = (255, 0, 0)

I'd like to change the code above to the following format.

import RPi.GPIO as GPIO
import neopixel

GPIO.setmode(GPIO.BOARD)

pixels = neopixel.NeoPixel(blanks, 144)

for i in range(0, 144):
    pixels[i] = (255, 0, 0)

How should I change the blanks? Or how should I change the code?

0

There are 0 answers