A twinkling pendant programmed in Lisp


My latest project is a pendant based on an ATtiny3227 that you can program in uLisp to make its six coloured LEDs twinkle in different patterns:

Here’s an example of a program for the Lisp Star that makes each LED flash at a regular rate, but the rates of all six LEDs are slightly different, producing a pattern that seems never to repeat:

(defun twinkle ()
  (dotimes (x 6) (pinmode x :output))
  (dotimes (n 6000)
    (let ((m (+ n 200)))
      (dotimes (i 6)
        (digitalwrite i (zerop (mod m (+ 30 i))))))
    (delay 100)))

For more information see: Lisp Star