Pair of scripts to update the progress variable in a pixel blaze script
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Morgan 'ARR\!' Allen 590e56dcdd README.md 5 months ago
README.md README.md 5 months ago
main.py linuxcnc > mqtt and mqtt > pixelblaze scripts 5 months ago
pb_proxy.py linuxcnc > mqtt and mqtt > pixelblaze scripts 5 months ago

README.md

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