Comments (2)
sample program
https://github.com/jgarff/rpi_ws281x
https://github.com/rpi-ws281x/rpi-ws281x-python
led
https://gist.github.com/knorth55/e7eda28fb1a185b2070a8c982fe5b6eb
IMPORTANT:
https://github.com/jgarff/rpi_ws281x#spi
from rmui.
import time
from rpi_ws281x import Color
from rpi_ws281x import PixelStrip
# LED strip configuration:
LED_COUNT = 1 # Number of LED pixels.
# LED_PIN = 12 # GPIO pin connected to the pixels (12 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 = 127 # 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
def colorWipe(strip, color, wait_second):
"""Wipe color across display a pixel at a time."""
for i in range(strip.numPixels()):
strip.setPixelColor(i, color)
strip.show()
time.sleep(wait_second)
def main():
strip = PixelStrip(
LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA,
LED_INVERT, LED_BRIGHTNESS, LED_CHANNEL)
strip.begin()
try:
while True:
colorWipe(strip, Color(255, 0, 0), 0.5) # Red wipe
colorWipe(strip, Color(0, 255, 0), 0.5) # Blue wipe
colorWipe(strip, Color(0, 0, 255), 0.5) # Green wipe
except KeyboardInterrupt:
colorWipe(strip, Color(0, 0, 0), 0.01)
if __name__ == '__main__':
main()
LED can be used with this program!
from rmui.
Related Issues (6)
- IMU selection HOT 1
- Speaker selection HOT 3
- Battery and power supply HOT 1
- Proximity sensor selection
- Pressure sensor HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rmui.