Week 5: Wendel the Lamp

It’s been an exceptionally busy week, so my weekly project is a tiny one.

I needed an adjustable lamp for to illuminate some figurines I was painting, so I built one with stuff I had lying around. I call it Wendel.

wendel01crop

The base and adjustable arm are built from a Tamiya Universal Plate Set and Universal Arm Set respectively. The light source is a board of my own design from last year: a 4×4 array of the very popular Worldsemi WS2812 addressable surface mount LEDs with decoupling capacitors, plus a laser-cut frosted acrylic diffuser. The light board is stuck on with double-sided tape, and the wiring is threaded (with some slack) through supports in the arm.

An Arduino drives the lights. All it does is keep them all at full brightness.

This is obviously a ridiculously inefficient design for a white lamp–these are RGB LEDs, and it’s pretty silly to have an Arduino there just to tell them to be white!–but it does produce a nice, broad, diffused light. Most importantly, I made it in about an hour with things I had lying around–most of the time spent figuring out how to use the Tamiya parts. And it works great for what I needed it for!

And doing it this way means I can adjust the color temperature by reprogramming it, which is pretty neat.

Anyway, I’ll have a more interesting project next week, hopefully. 🙂

wendel00crop

9V Battery Discharge Experiment

During a break on working on my Ludum Dare 30 entry (which I’ll post about a bit later), I conducted this little experiment:

You might want to watch it in HD on Youtube. The changes are subtle!

It’s a timelapse through a macro lens of a 9V battery (with the outer skin removed) being discharged for 20-25 minutes or so. I’d have liked to run it longer but my camera ran out of power! I discharged it the rest of the way off-camera and it looks rather dramatically different from a new one.

Note that only cheap, generic 9V batteries look like this on the inside! Brand-name batteries tend to be constructed of a set of 6 roughly AAAA-sized cylindrical cells. Which is kind of neat in its own right, but doesn’t give you a nifty view of what’s going on inside like these cheap ones do. 🙂

Week 1: μShooter

The Microview is a tiny Arduino-compatible device with a built-in OLED screen. It’s really nifty, and I’ve been looking forward to mine ever since backing the Kickstarter earlier this year. The other day it finally arrived, so as my first weekly project, I’ve made a simple game on it: a minimalist Gradius-style side-scrolling shooter.

The source code (an Arduino sketch) is available here! It expects an analog input (just one axis) on the Microview’s analog pin 5 and a button input (active HIGH) on digital pin 0. You could easily switch it to use two buttons for the movement instead of a joystick (it doesn’t even use proportional input). Here it is on a breadboard:

I love that the joystick alone is bigger than the μView.

Features:

  • Two types of enemies, a ‘diver’ than speeds toward you at high speed and a ‘tracker’ that moves a little slower but veers toward you when it gets close.
  • High score kept in EEPROM so it persists between runs.
  • No timing whatsoever, aside from a delay(10) in the main loop. Framerate is surprisingly consistent (and pretty good!) despite that. I’m guessing updating the OLED is the bottleneck.
  • Fills up less than half of available program memory and only ~800bytes of SRAM on the microcontroller, so there’s plenty of space for new features. 🙂
  • Text-based graphics in glorious 1-bit color!
  • Poorly organized, barely commented source code and bugs, bugs, bugs!

This was a quick one–about 3-4 hours of effort (including fixing the Microview). I’ll be participating in Ludum Dare 30 over the weekend, so I’ll hopefully have a second game to post by Sunday night! (Not on the μView though. It’d make it rather hard for people to review…)