I wrote a small video output library called TVout. It is completely interrupt driven to make writing things that need tvout easier.
It runs on a resolution of 128x96 with some basic text printing and line and dot drawing for now.
For the now its NTSC only and restricted to using pin8 for video data and pin9 for the sync signal, ascii art ;):
Pin9: Sync line: -->|--///--o
1Kohm |
Pin8: Video line: -->|--///--o---------------- RCA tip
330ohm |
o--/--///--o-- RCA GND
75ohm |
V
GND
Video of the included demo sketch:
Here is the example .pde included with the library.
#include <TVout.h>
TVout TV;
char x,y;
void setup() {
x=0;
y=0;
TV.start_render();
}
void loop() {
delay(2000);
TV.clear_screen();
x=0;
y=0;
for (char i = 32; i < 127; i++) {
TV.print_char(x*6,y*8,i);
x++;
if (x >20) {
y++;
x=0;
}
}
delay(2000);
TV.clear_screen();
TV.print_str(0,0,"fill screen pixel");
TV.print_str(0,8,"by pixel");
delay(2000);
TV.clear_screen();
for(x=0;x<127;x++){
for(y=0;y<95;y++){
TV.set_pixel(x,y,1);
}
}
delay(2000);
TV.clear_screen();
TV.print_str(0,0,"draw some lines");
delay(2000);
for(y=0;y<95;y++){
delay(10);
TV.draw_line(0,y,x-y,y,1);
}
}
It would be great to have feed back on this as I have only had one tv to test this on. If anyone wants to try it, it must be noted that no other interrupts can run along side this as it will mess with the video signal (the sync signal will be fine but the video not so much).
Also this release was only tested on an arduino with a ATMega328p, the 168, and 8 do not have enough memory for this resolution. I dont know if the mega will work as is, it may but I do not know if the pins are mapped the same (OC1A on PORTB0).
First post so a download link is in the next post.