Makevember #1

So it turns out that November is Makevember. This link was shared with me on twitter https://www.bricolage.run/blog/2018/10/31/makevember-manifesto-2018 and it seemed like a good idea to get involved in.

My plan is to try and do a small or quick make every day in November and to post a short blog post on here to explain what I’ve been doing and to give people more insight that a twitter post will allow.

It’s also a good way to get me back into writing posts on here too.

The hope is to do 30 makes and 30 blog posts so be warned.

The quality might not be great and some fo the makes may fail miserably, but the hope is I’ll learn something through failure and if a make doesn’t work then it might be a stepping stone to a new idea or project.

So with that in mind, here’s make #1.

Taking the basic code from my raspberry pi/Unicorn weather station I’ve reduced it to a random number generator and two colours. Red and Green. It’s a simple system that will sit underneath the Christmas tree and light it up from underneath with Christmassy green and red. The random number means there is less of a pattern to the colours rather than a regularly changing pattern.

!/usr/bin/env python3

import unicornhat as uh
import time
import colorsys
import time
from random import randint

uh.set_layout(uh.PHAT)
uh.brightness(1.0)

spacing = 360.0 / 16.0
hue = 0


while True:
        for x in range(8):
                for y in range(4):
                        uh.set_pixel(x, y, 255, 0, 0)
        uh.show()
        t = randint(10, 30)
        time.sleep(t)


        for x in range(8):
                for y in range(4):
                        uh.set_pixel(x, y, 0, 255, 0)
        uh.show()
        t = randint(10, 40)
        time.sleep(t)