README.md

This commit is contained in:
Morgan 'ARR\!' Allen 2023-04-19 13:39:59 -07:00
parent 712fddeec8
commit 590e56dcdd

40
README.md Normal file
View file

@ -0,0 +1,40 @@
# LinuxCNC to Pixelblaze Progress Bar
Will work with any Pixelblaze script that declares and uses...
```
export var progress = 0;
```
Example of the adapted Block Reflection script.
```
export var progress = 0.6;
export function beforeRender(delta) {
t2 = time(0.1) * PI2
t1 = time(.1)
t3 = time(.5)
t4 = time(0.2) * PI2
}
export function render(index) {
if(index > (progress * pixelCount)) return hsv(0,0,0);
h = sin(t2)
m = (.3 + triangle(t1) * .2)
h = h + (((index - pixelCount / 2) / pixelCount * ( triangle(t3) * 10 + 4 * sin(t4)) % m))
s = 1;
v = ((abs(h) + abs(m) + t1) % 1);
v = v * v
hsv(h, s, v)
}
```
This requires running both Python 2 and Python 3 (sooooorrry), because current LinuxCNC 2.8 only supports Python 2
and the pixelblaze-client only supports Python 3. These will be merged to a single script when LinuxCNC 2.9 because
current.
# Prerequisites
```
pip install paho-mqtt pixelblaze-client
```