Pixoo sign client for Ruby
This is just a client for the Pixoo 64 sign written in Ruby.
Example usage
Draw some stuff and then display it as an animated image:
include Pixoo :: Utils images = [ 7 , 17 , 29 ] . map { | m | img = Pixoo :: ImageBuffer . new 64 , speed : 500 64 . times do | x | 64 . times do | y | if ( ( x | y ) % m ) . zero? img . set_pixel x , y , * ( rainbow_color ( x ) ) end end end img } dev = Pixoo :: Client . find_all . first dev . send_animation images sleep 1 # add some text dev . send_text "Hello" , x : 0 , y : 0 , id : 1 dev . send_text "World" , x : 0 , y : 40 , id : 2 , font : 6
Read a PNG and display it:
img = Pixoo :: ImageBuffer . from_png ARGV [ 0 ] dev = Pixoo :: Client . find_all . first dev . send_animation [ img ]
Reading from a remote server
This thing supports reading values from a remote server. I have a server that collects PM2.5 / CO2 sensors I have in the house. On the server, I have a webrick server that response to requests for sensor info. For example to get the PM2.5 data from my office, I can do this:
$ curl 'http://tender.home:9292/reading?floor=main&room=office&measurement=pm2.5' {"DispData":"25"}
... continue reading