Programming

Laser Modem with an Arduino Microcontroller

Submitted by esalazar on Mon, 08/11/2008 - 7:03pm.
Serial data transition from a Arduino controller using a standard red laser, photo transistor and an instrumentation amplifier.

This started when I ordered an IR led and phototransistor pair from Spark Fun along with some spare ATMega168 microcontrollers. I first experimented using the IR led to transmit 2400 baud serial to the phototransistor. I programmed my Arduino Diecimila with the sample serial program altering the baud rate and allowing it to run in a continuous loop.

Fractal Mountain Generation with Qt and OpenGL

Submitted by esalazar on Mon, 02/04/2008 - 9:29pm.
The purpose of this project is to create 3d mountain terrain using a recursive midpoint displacement formula. For this project I decided a GUI would be useful, that way manipulations could be seen in real time. This would require a 3d rendering package. My choices were DirectX, OpenGL and Java3d. Since I prefer to do my development in Linux, DirectX was ruled out. I have not been very impressed with the performance of Java3d so that left me with OpenGL. After deciding on my rendering package I needed to choose a language and a GUI framework. GLUI is an excellent framework for leaning OpenGL, but lacks control over the layout of the interface. So I decided on QT by Trolltech which was just recently acquired by Nokia.

Midpoint Displacement Formula

Encoding an image to sound

Submitted by esalazar on Mon, 01/07/2008 - 8:36pm.
The purpose of this project is to encode an image to a sound that can be viewed with a spectrogram. For some time I have known that musical artists have encoded pictures into their music. Most notable of these is artists is Aphex Twin. Luckily I had a copy of Windolicker and a great visualization program Sonic Visualiser. After looking at the images I decided it would be cool to try and encode my own images. I saw a few programs available, but decided it would be a better challenge to write my own program from scratch using Perl.

Spectrograms

Class Serialization in Perl

Submitted by esalazar on Thu, 12/27/2007 - 6:15pm.
Serialization in Perl is the process of saving a class with multiple data types to a scalar (string of bytes). This can be used to save objects to a file or to transmit objects across the Internet. For this article I am going to describe the basics of creating a class in Perl and serialize it using the following packages: Data::Dumper, FreezeThaw, PHP::Serialization, and XML::Dumper.

Data types in Perl
Before we serialize anything we first need to learn a bit about the data types in Perl. There are only three data types in Perl, these are scalars, arrays and hash tables. Below is an example of each.
$myScalar = 'This is a Scalar';

Basic Stamp tokenizing and flashing from the Linux CLI

Submitted by tdavis on Thu, 12/06/2007 - 5:21pm.

For those of you who aren't familiar with the Basic Stamp, its a small microcontroller available from Parallax. It runs at a whopping 20Mhz and has a full 2K of storage on board for instructions. Although it may not sound like much, its more than enough to program the stamp to do some interesting things. The Basic Stamp is programmed in PBASIC, parallax's version of BASIC the stamp interprets.

Rather than waste your time explaining the coolness of the Basic Stamp, (if you've found this page you're probably already interested) I want to focus on how it can be utilized under linux. Currently, Parallax has a very nice PBASIC IDE but its available for windows only. It can however be run under Wine, and with the proper font settings it doesn't look too horrible and is quite functional. But what is the fun in that?