You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+82-24
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,18 @@ On the raspberry you open a terminal window and type following commands:
10
10
* make
11
11
* sudo chmod +x ws2812svr
12
12
13
+
On newer Raspbian (Jessie) operating system the audio output is activated by default, you need to disable this:
14
+
You can do this by blacklisting the sound module:
15
+
sudo nano /etc/modprobe.d/snd-blacklist.conf
16
+
17
+
*blacklist snd_bcm2835
18
+
19
+
also in /boot/config.txt you comment out the audio=on parameter:
20
+
```
21
+
# Enable audio (loads snd_bcm2835)
22
+
#dtparam=audio=on
23
+
```
24
+
13
25
#Testing
14
26
Connect your LEDs to the PWM output of the Raspberry Pi and start the program:
15
27
@@ -18,7 +30,8 @@ Connect your LEDs to the PWM output of the Raspberry Pi and start the program:
18
30
Now first initialize the driver code from jgarff by typing 'setup'.
19
31
On the following line you must **replace 10** by the number of leds you have attached!.
20
32
21
-
* setup channel_1_count=10
33
+
* setup 1,10
34
+
* init
22
35
23
36
Now you can type commands to change the color of the leds.
24
37
For example make them all red:
@@ -27,25 +40,35 @@ For example make them all red:
27
40
* render
28
41
29
42
#Supported commands
30
-
Here is a list of commands you can type or send to the program. All commands have optional comma seperated parameters. The parameters must be in the correct order except for the 'setup' command.
43
+
Here is a list of commands you can type or send to the program. All commands have optional comma seperated parameters. The parameters must be in the correct order!
31
44
32
45
* Setup command must be called everytime the program is started:
33
46
```
34
47
setup
35
-
channel_1_count=1, #number of leds on channel 1
36
-
freq=800000, #frequency used to talk to the leds
37
-
dma=5, #dma channel
38
-
channels=1, #number of led strings / PWM outputs / channels used
39
-
channel_1_gpio=18, #GPIO number of channel 1
40
-
channel_1_invert=0, #Invert the output of channnel 1 (in case you are using an 3.3V->5V level shifter)
41
-
channel_1_brightness=255, #default brightness of the leds (can be changed with brightness command)
42
-
channel_2_count=0, #number of leds in channel 2
43
-
channel_2_gpio=0, #GPIO number for channel 2
44
-
channel_2_invert=0, #invert the output of channel 2
45
-
channel_2_brightness=255 #brightness for channel 2
46
-
47
-
Example:
48
-
setup channel_1_count=10
48
+
setup
49
+
<channel>, #channel number
50
+
<led_count>, #number of leds in channel
51
+
<led_type>, #type of led (3 color or 4 color) default 0
52
+
<invert>, #invert output, default 0
53
+
<global_brightness>, #global brightness level for channel (0-255), default 255
54
+
<gpionum> #GPIO output number, 18 for PWM0 = pin 12, 24 for PWM1 = pin 35, default 18
55
+
56
+
Possible LED types:
57
+
0 WS2811_STRIP_RGB
58
+
1 WS2811_STRIP_RBG
59
+
2 WS2811_STRIP_GRB
60
+
3 WS2811_STRIP_GBR
61
+
4 WS2811_STRIP_BRG
62
+
5 WS2811_STRIP_BGR
63
+
6 SK6812_STRIP_RGBW
64
+
7 SK6812_STRIP_RBGW
65
+
8 SK6812_STRIP_GRBW
66
+
9 SK6812_STRIP_GBRW
67
+
10 SK6812_STRIP_BRGW
68
+
11 SK6812_STRIP_BGRW
69
+
70
+
Example:
71
+
setup 1,10,0
49
72
```
50
73
51
74
* Render command sends the internal buffer to all leds
@@ -81,21 +104,56 @@ fill
81
104
<RRGGBB>, #color to fill (default FF0000)
82
105
<start>, #at which led should we start (default is 0)
83
106
<len> #number of leds to fill with the given color after start (default all leds)
84
-
```
85
-
86
-
* brightness command changes the brightness of the leds without affecting the color value
87
-
```
88
-
brightness
89
-
<channel>, #channel to change brightness (default 1)
90
-
<brightness> #brightness 0-255 (default 255)
107
+
<OR,AND,XOR,NOT,=> #bitwise operator to execute on OLD and NEW color, default = copies new color to output
91
108
```
92
109
93
110
* delay command waits for number of milliseconds
94
111
```
95
112
delay
96
113
<milliseconds> #enter number of milliseconds to wait
97
114
```
98
-
115
+
116
+
*brightness command changes the brightness of a single or multiple leds without changing the actual color value
117
+
```
118
+
brightness
119
+
<channel>, #channel number to change brightness (default 1)
120
+
<brightness>, #brightness to set (0-255, default 255)
121
+
<start>, #start at this led number (default 0)
122
+
<len> #number of leds to change starting at start (default led count of channel)
123
+
```
124
+
125
+
*fade command changes the brightness over time
126
+
```
127
+
fade
128
+
<channel>, #channel to fade
129
+
<start_brightness>, #start brightness (default 0)
130
+
<end_brightness>, #end brightness (default 255)
131
+
<delay ms>, #delay in ms
132
+
<step>, #step to increase / decrease brightness every delay untill end_brightness is reached
133
+
<start_led>, #start led
134
+
<len> #number of leds to change starting at start (default is channel count)
135
+
```
136
+
137
+
*gradient command makes a smooth change of color or brightness level in a channel
138
+
```
139
+
gradient
140
+
<channel>, #channel number to change
141
+
<RGBWL>, #which color component to change, R = red, G = green, B = blue, W = white and L = brightness level
142
+
<start_level>, #start at color level (0-255) default is 0
143
+
<end_level>, #end at color level (0-255) default is 255
144
+
<start_led>, #start at led number (default is 0)
145
+
<len> #number of leds to change (default is channel count)
146
+
```
147
+
148
+
*random command can create a random color
149
+
```
150
+
random
151
+
<channel>, #channel number to change
152
+
<start>, #start at this led
153
+
<len>, #number of leds to fill with a random color, default is channel count
154
+
<RGBWL> #color to use in random can be R = red, G = green, B = blue, W = White, L = brightness also combination is possible like RGBW or RL
155
+
```
156
+
99
157
#Special keywords
100
158
You can add `do ... loop` to repeat commands when using a file or TCP connection.
0 commit comments