A clojure library to control led-stripes (and other pixels)
-
Install a current Java $ sudo apt install openjdk-8-jre-headless
-
Install Leiningen $ sudo wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein -O /usr/local/bin/lein $ sudo chmod +x /usr/local/bin/lein
-
Clone pentapxlz $ git clone https://github.com/c3d2/pentapxlz.git
$ cd pentapxlz
$ lein run
## View current state on cmdline (via eventstream + ansi-escape-sequences)
$ curl 'http://localhost:8080/frame?target=ledbeere&streamevery=100&ansicolor=true'
- For more features read the API-Documentation
Interact via Repl
$ cd pentapxlz
$ lein repl
> (-main)
> (pentapxlz.process.util.registry/ls-started)
> (pentapxlz.process.util.registry/stop-all!)
> (pprint (pentapxlz.process.util.registry/ls))
> (pentapxlz.process.util.registry/start! :renderer/ledbeere-frame)
;; set some pixels
(set-simple! :state/ledbeere-frame [:green :blue])
(set-simple! :state/ledbeere-frame (cycle (segments [[1 :red] [10 :yellow]])))
;; using frame-generators
(set-simple! :state/ledbeere-frame (resolve-generator {:type :generator/cycled
:chain [:generator/segments]
:nr+colors [[1 :blue] [10 :yellow]]}))
;; Read documentation and sources & try it yourself
> (source pentapxlz.core/-main)