Showing posts with label color. Show all posts
Showing posts with label color. Show all posts

Sunday, June 29, 2008

Gif2led released, and with AVR LED Egg demostration!

We have worked on LED matrix for so many times, but mostly for text scrolling, so how about make some animations on it? But we are too lazy to make the animation patterns to the C header file in an array of bytes. We finally finished one tool may be useful for all led matrix lovers!

The gif2led project is written in Ruby, required Rmagick library for gif manipulation. It is mainly designed for 8 or less columns matrix, for instance 8x8 matrix, 10x8 matrix, 5x7 matrix etc. It output an pattern header file with a 2D array frame by frame from an animated gif input. We only tested with AVR-gcc, but it should be useful for other MCUs too. You can find more information on the gif2led project page, http://labs.bitartist.org/gif2led/

Let start with our demonstration, the project is called LED Egg, it is based on a 10x10 matrix (but we only use 10x8 in our case) with an Egg case to hold the circuit board.

To prepare the animated gif, we use macromedia Flash, and here is the screenshot:



Noted that the frame 0 (marked as CAL above) is a special frame, which used for calibration. When used with gif2led tool, the frame 0 is the pattern of your led matrix with all led ON.

and then export the movie to an animated gif:



Then simply run the following command, we can obtain the 2D array header file:
ruby gif2led pattern.gif 20 > pattern.h
//selected ratio is 20.0%
//Cal result: LED Matrix (row*col) = (10*8)
const unsigned char pattern[63][10] PROGMEM = { //Frame 0 {0x42,0x00,0xa5,0x00,0x84,0x21,0x00,0x42,0x21,0x84} //Frame 1 ,{0x00,0xa5,0x00,0x84,0x21,0x00,0x42,0x21,0x84,0x42}
...
...
#define MAX_FRAME 63
#define ROWS 10
Now, we have to prepare the circuit part, we use AVR tiny13 together with 4017, please refer to the circuit diagram<here>. 4017 is used as a row counter, and such that we can only use 1 pin for row shifting. The remaining 4 IOs of the tiny13 would use for column output, we are using 10x8 matrix this time, so we assume the pattern is symteric to save pins, so 1 I/O drive 2 columns in our case. The circuit showed below:



So Lets add an egg case, the egg is made from pu foam plastic, it is used for Easter decoration.





Video demonstration:


Close look on the LED pattern:



To download the gif2led tool, AVR source codes, and flash template, please find in the following links:

Gif2led project page:
http://labs.bitartist.org/gif2led/


Gif2led Rubyforge page:
http://rubyforge.org/projects/gif2led/

Thursday, June 19, 2008

Philips LED Lamp Featuring 16M colors!


Wow, philips worked on many LED products recently, and here we have a LED lamp for your living room.
May be someone can use for some art projects. The controller is very cool, it is a touch wheel and you can change and set the color easily. May be you can try to set the color to reflect your mood everyday. Enjoy.



More Info by unplggd

Saturday, March 22, 2008

Sky Color Project - What is the color of the sky today?




In this easter, we finished a "non-electronic" project and find no where to post. Hope it is not so off topic here:)

There are few web cameras installed to monitor the weather or traffic conditions online, so what else information can we get from these images? One important thing to us is the color of the sky. It is a sign of weather and also the pollution condition. So this small project comes up.

we developed a program to analyze the color of the images and look for the best blue.

The process includes four steps:
1) Fetching image from the web camera (an automatic web image fetcher is used)
2) Color Segmentation (Masking out the non-sky component)
3) Analyze the blueness (Finding out the best blue)
4) Output a small square image colored in best blue found in step 3

The color segmentation is the most difficult part, the blueness is hard to define. Luckily, we can easily find many digital images nowadays in flickr or other online gallery system. We used the images to train our color segmentation engine and also with some human fine tunings.

We got 365 images from the Hong Kong Observatory (Yes, we live in HK) in the year 2006.
The sky with no blue-like color is ignored in step 4, it happened in cloudy or rainy or dusty day and so you will see a gray or white cloudy sky, i.e. no color captured.


A processed image from step 1 - 3
(Buildings are masked)

A sky color palette is generated for the year 2006 in HK:

- the pink box is the start of the month (e.g. JAN)

In a statistical view, we make a sky color bar chart for each month.

What we can get in this chart?
1) Second half of the year, we get a clearer sky.
2) In August, we have more blue sky days.