July 2009
18 posts
basic arduino sketch for a 28 color vga...
this arduino sketch displays a 32x32 pixel image. two potentiometers can been hooked up to analog inputs 0 and 1 for adjusting/corrupting the hsync/vsync. a potentiometer on analog input 2 scrolls the image vertically and adjacent memory. images can be uploaded via serial.
// copy-it-right
#define VSYNC 1 << 0
#define HSYNC 1 << 1
// high voltage (bright) RGB
#define HR 1...
indexed image to avr pin bitmap
this python script converts an indexed image to the avr pin bitmap equivalent. uses a special gimp palette that maps indexed colors to the pin bitmap. i.e. for the 28 color gimp palette, a bright red indexed pixel will be converted to the byte 00100100.
usage: img2avr.py palette.gpl image.png > image.out
img2avr.py
# copy-it-right
import sys
from PIL import Image
def...
28 color gimp palette generator
this python script generates a gimp palette which you can use to convert rgb images to an indexed image which can be converted for use on the avr.
# copy-it-right
def main():
colors = set()
print 'GIMP Palette'
print 'Name: avr-vga'
print 'Columns: 0'
print '#'
for n in range(0, 256):
b = bin(n)[2:].rjust(8, '0')[:-2] + '00'
colors.add(b)
colors =...
28 color gimp palette
GIMP Palette
Name: avr-vga
Columns: 0
#
0 0 0 00000000
0 0 127 00010000
0 0 255 10010000
0 127 0 00001000
0 127 127 00011000
0 127 255 10011000
0 255 0 01001000
0 255 127 01011000
0 255 255 11011000
127 0 0 00000100
127 0 127 00010100
127 0 255 10010100
127 127 0 00001100
127 127 127 00011100
127 127 255 10011100
127 255 0 01001100
127...