projects:commerce_st

This is an old revision of the document!


  • change parameters for stepper motor (read by pinPulse.sh)
sshpass -p yourpassword ssh debian@beaglebone.local "echo 0.5 > /home/debian/pulse_on"
sshpass -p yourpassword ssh debian@beaglebone.local "echo 2 > /home/debian/pulse_off"
  • LED strip test
import socket, struct, time, sys
ipAddr = sys.argv[1]
NUM_PIXELS = 16
 
pixels = bytes([255, 0, 0] * NUM_PIXELS) # RED
header = struct.pack('>BBH', 0, 0, len(pixels))
packet = header + pixels
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.sendto(packet, (ipAddr, 7891))
time.sleep(0.05)
s.sendto(packet, (ipAddr, 7891))
  • led strip fade test
import socket, struct, time, math, sys
ipAddr = sys.argv[1]
 
NUM_PIXELS = 16
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
 
# Prime the buffer
pixels = bytes([255, 0, 0] * NUM_PIXELS)
header = struct.pack('>BBH', 0, 0, len(pixels))
s.sendto(header + pixels, (ipAddr, 7891))
time.sleep(0.05)
 
# Now update continuously
i = 0
while True:
    r = int((math.sin(i * 0.05) + 1) * 127)
    pixels = bytes([r, 0, 0] * NUM_PIXELS)
    header = struct.pack('>BBH', 0, 0, len(pixels))
    s.sendto(header + pixels, (ipAddr, 7891))
    time.sleep(0.033)
    i += 1
  • projects/commerce_st.1782488998.txt.gz
  • Last modified: 2026/06/26 10:49
  • by John Harrison