Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- from rpi_ws281x import PixelStrip, Color
- import argparse
- import RPi.GPIO as GPIO
- import board
- import neopixel
- # LED strip configuration:
- LED_COUNT = 150 # Number of LED pixels.
- LED_PIN = 18 # GPIO pin connected to the pixels (18 uses PWM!).
- # LED_PIN = 10 # GPIO pin connected to the pixels (10 uses SPI /dev/spidev0.0).
- LED_FREQ_HZ = 800000 # LED signal frequency in hertz (usually 800khz)
- LED_DMA = 10 # DMA channel to use for generating signal (try 10)
- LED_BRIGHTNESS = 255 # Set to 0 for darkest and 255 for brightest
- LED_INVERT = False # True to invert the signal (when using NPN transistor level shift)
- LED_CHANNEL = 0 # set to '1' for GPIOs 13, 19, 41, 45 or 53
- # Create NeoPixel object with appropriate configuration.
- strip = PixelStrip(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS, LED_CHANNEL)
- # Intialize the library (must be called once before other functions).
- strip.begin()
- print("BEENDE...")
- pixels = neopixel.NeoPixel(board.D18, 150)
- pixels.fill((255,255,255))
- time.sleep(0.5)
- pixels.fill((0,0,0))
- time.sleep(0.5)
- pixels.fill((155,155,155))
- time.sleep(0.5)
- pixels.fill((0,0,0))
- time.sleep(0.5)
- pixels.fill((55,55,55))
- time.sleep(0.5)
- pixels.fill((0,0,0))
- for b in range(0,256):
- pixels.fill((b, b, b))
- for d in range(0,256):
- pixels.fill((255-d, 255-d, 255-d))
- if d%10 = 0:
- print(d)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement