Welcome to your personal Lisp Machine! This is a 32-bit computer with limited memory and little permanent storage.
It's running a bespoke version of uLisp that contains special functions for operating the (very bright) LEDs.
It runs a subset of Common Lisp, take a look at getting started and the language reference
To connect to it:
stty -F /dev/ttyACM0 9600 raw -clocal -echo icrnl ; screen /dev/ttyACM0 9600
When connected you should see
enter ~ to use LISP enter ~ to use LISP enter ~ to use LISP
You now have a full REPL!
2329> (+ 1 1 40) 42 2329>
Each light is set by three 8-bit concatenated numbers (red, green, blue). Seding these directly to
disp will set all the lights to that RGB color:
(disp 127 0 0) ; red 50% (disp 0 255 0) ; green 100% (disp 0 0 127) ; blue 50% (disp 64 0 32) ; purple (disp 255 255 255) ; blinding
The convenience function
disp is overloaded, sending
disp four numbers independently operates each light, use
make-color to set them to different RGB colors:
(disp (make-color 4 0 0) (make-color 0 4 0) (make-color 0 0 4) (make-color 2 0 1))
disp-off or just
(disp) turns all lights off
The 'animate' function utilizes the global variable 'animate-colors'. Set 'animate colors' to a list of 4 colors to cycle through:
(defvar animate-colors (list (make-color 4 0 0) ; red (make-color 2 0 0) ; less red (make-color 0 0 0) ; off (make-color 0 0 0))) (animate)
user to whatever you like
(defvar user "Sexy Beast") (animate)
Save all your changes and specify the startup function!
Use millis to get the milliseconds since startup and delay to pause
Unorganized code can be found here on github