Twinkle Twinkle little star

… How I wonder what you are?

I know what this is… 10 minutes work in OpenSCAD, glow in the dark PLA + some careful slicing, and a SeedStudio XIAO RP2040 running micropython.

The XIAO is really wasted doing this… but the board costs 6 Euros (inc. postage) and has an onboard NeoPixel; I brought it for other reasons but I figured it could be put to use on my tree in the meantime.

SCAD:

// Christmas star with cutout for Xiao RP 2040
$fn=180;

difference() {
  translate([0,0,60])
  for (a=[-140,-70,0,70,140]) {
    hull() {
      sphere(18);
      rotate([a,0,0]) translate([0,0,70]) sphere(6);
    }
  }
  linear_extrude(height=62,convexity=10)
    translate([0,-9]) square([6,18]);
}

main.py

from machine import Pin
import neopixel
from utime import sleep
from random import choice

pixel = neopixel.NeoPixel(Pin(12), 1)
pixelPower = Pin(11, Pin.OUT)
pixelPower.on()

speeds = range(1,6,1)
intensities = [1,2,3,7,15,31,47,63,95,127,255]

while True:
    val = choice(intensities)
    cycle = [(val,0,0),(val,val,0),(0,val,0),(0,val,val),(0,0,val),(val,0,val)]
    for pixel[0] in cycle:
        pixel.write()
        sleep(choice(speeds)*0.015)

I’ll post an ‘action shot’ and link to the (rather large) .stl later.

4 Likes

And here is the ‘Action Shot’ as promised…

Not animated (to spare your senses)…

I have this on Thingieverse here: XAIO RP2040 twinkling christmas star by Nanocube - Thingiverse

  • with some affiliate links for the board if anyone wants to build one…
3 Likes