estruyf / unicorn-busy-server

Simple busy light server for Raspberry Pi Zero and Pimoroni Unicorn Hat
MIT License
61 stars 38 forks source link

A seperate DND status would be great #26

Open semeif opened 3 years ago

semeif commented 3 years ago

First of all I love this project and the implementation was really smooth! I started playing with the unicorn HAT in between and created a simple DND (3 lines red, 2 lines white, 3 lines red) But I'm really bad in python and don't know where to implement the additional status. Here is my code for the DND status:

unicorn.set_layout(unicorn.AUTO) unicorn.rotation(90) # tested on pHAT/HAT with rotation 0, 90, 180 & 270 unicorn.brightness(0.5) width,height=unicorn.get_shape() red = [0,1,2,5,6,7] white =[3,4]

for y in red: for x in range(width): unicorn.set_pixel(x,y,255,0,0) unicorn.show() time.sleep(0.05)

for y in white: for x in range(width): unicorn.set_pixel(x,y,255,255,255) unicorn.show() time.sleep(0.05)

unicorn.show()

======================= time.sleep is just for animation purpose and not mandatory.

Maybe someone finds some time to implement this.

Cheers, Sebastian