1

How can I check if the one pixel is on or not? Is there any function for that. I've googled but couldn't find anything helpful.

import board
import neopixel
pixels = neopixel.NeoPixel(board.D18, 17)


def lightOnMedi():
    pixels[0] = (255, 0, 0)
    pixels[1] = (255, 0, 0)
    pixels[15] = (255, 0, 0)
    pixels[16] = (255, 0, 0)

My program has to trigger another method when one of the pixels (0,1,15 or 16) are turned ON.

  • 1
    You need to keep track of which LEDs you have switched on and off. – joan Jun 26 '19 at 17:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.