AVR Programming 04: Writing code, etc.


Welcome back to this fourth and final installment of the series. The first three parts should have been enough to get you off the ground, but a few more learning examples wouldn’t hurt. It’s also a good time to discuss some of the other things these little chips can do. Join me after the break to:

  • Expand the sample code, adding features to our simple program while I challenge you to write the code yourself.
  • Discuss AVR fuse bits, how to use them, and what to watch out for
  • Touch on some of the peripherals you’ll come across in these chips

As a grand flourish to the series, I’ve used the example hardware from this final part to build a bicycle tail light. Hopefully this will inspire you to create something much more clever.

Series roadmap:

[Read more...]

Communicating with an LED matrix

Most of the LED matrix posts we run delve into the hardware design. This time around [J Bremnant] used prefab modules and focused on writing code to address the display. The hardware combines two 24×16 LED boards from Sure Electronics with a Teensy 2.0 to drive the display and provide a USB connection. The firmware comes in just under 8k, leaving graphic manipulation up to a PC.

[J Bremnant's] Python script offers a lot of flexibility when working with the display. There are three modes selectable through a terminal interface. One just tests the display and then drops into Conway’s Game of Life. The second mode lets you send commands via serial interface so it can be used as a message ticker. The final feature is frame addressing that allows graphics to be dropped into the display. See each of these featured in the video after the break.

[Read more...]

Arduino + Java + Joystick

Interfacing your own hardware with a Java app couldn’t be easier than this example. [Pn] created this proof-of-concept using an Arduino, an analog joystick from a gaming controller, and a few lines of Java code. The Arduino reads an ADC value from the joystick’s x-axis and transmits it over the serial connection ten times a second. The Java program triggers on every serial event, parsing the data based on the @ symbol that the Arduino sends as a start and end condition.

We like this kind of example because there’s nothing extra involved. It lets you take the concept and run with it in any project imaginable. Be it a more complicated Joystick, or simple sensors that you’d like to interface with.

Key chain LCD as screen for a Dockstar

[Peter Gunn] added an LCD screen to his Dockstar. Now that we think of it, this really shouldn’t be all that hard since the Dockstar can run a Linux kernel and it has USB ports. [Peter] took inspiration from [Sprite_TM's] key chain LCD4Linux hack that we looked at many moons ago. He used a cheap Coby DP182 digital picture frame that can be picked up for less than $5 used. A bit of firmware hacking and LCD4Linux has no problem pushing images to the device via USB. [Peter's] setup refreshes the screen at one frame per second, but if all you need is a bit of feedback from the otherwise headless system this is a great solution.

[Thanks Mikka]

Projector introduces augmented reality to reality

[Raj Sodhi] and [Brett Jones] have been working on interactive augmented reality as part of their research at the University of Illinois. What they have come up with is a stylus-based input system that can use physical objects to create a virtual landscape. Above you can see that an environment was built using white blocks. A camera maps a virtual world that matches the physical design. From there an infrared stylus can be used to manipulate virtual data which is projected on the blocks.

What they’ve created is a very advanced IR Whiteboard. There are buttons on the stylus, one of which opens the menu, made up of circles that you can see above. From there, you can select a tool and make it do your bidding. After the break there’s a video demonstration where a game is set up, using the menu to place tanks and mines on the 3D playing field. We wonder how hard it would be to do this using a projector and a Kinect.

[Read more...]