VGA library for Arduino UNO and ATMega328

It is explained in the first post, but not in depth. This offers 2 bits, so 4 colours (or states as you wish). You have to decide what colours you choose, you could as well drop red or green to get an other set of colours. One of these states is 00, no colour, so black. You could also choose to have blue HIGH all the time, to get another extra palette. 00 would be blue. 01 would be purple. 10 would be cyan. And 11 would be white.

The reason is storage; to get a reasonable resolution, just drop a third of the memory needed. I can imagine it also saves some timing trouble, and it would help against the reported misalignment (chance of that would grow larger each added bit per pixel).

I am in the same situation as adgm1988, I attempted to run this on a Mega2650 using the same pins as the UNO and it didnt work. (tested with an uno, works ok so its not my dsub/resistor arrangement)

Are there any obvious reasons why it shouldnt work ? might it be something timer related ? I'd like to run it on a 2560 ideally so I can use Rugged Circuits QuadRam 512kb SRAM expansion, I thought it might be quite promising.

update - I managed to get Nick Gammon's VGA demo to work on the Mega2560, I'm not sure what might be different in VGAx any help would be appreciated.

Did someone try to use I2C with this library? Or will communicating via i2c break the VGA output?

The interrupt-handling required by I2C might throw out the VGA timings.

Off the back of Smaffers VGAX, I wrote a nice bit of code that drives a VGA monitor in 17bit colour Works on a Nano (and UNO) and seems quite smooth

Here it is in one project decoding 250kbps data streams presenting as a bar graph

Next UNO/VGA projects will involve a 16 input analogue voltage visualiser, colour spectrum analyser using FFT, and to finish the above youTube project with all its diagnostic DMX features

I absolutely LOVE driving video/TV/VGA from these little jiggers, for me it all started with the TVout library, then all Nicks investigations, AtomicZombie, and finally Smaffers code

I hope one day to post some really awesome projects, and show how sections of line handling can be driven using a really simple indexed array of vectors, which runs really fast (of which time is an absolute premium on VGA !)

I'm now using a $5 raspberry pi zero as the "graphics coprocessor" for the Arduino. Weird, I know ...

Hi. First I'd like to congratulate Smaffer for the library, is a very cool piece of soft, besize how useful it can be. Despite the purpose itself was to show color on a VGA display, I would rather prefer having a bit more resolution. Let's say 160x90 pixels B&W, this is to keep the 16:9 panoramic proportion of nowadays displays. It would use 1800bytes of SRAM I think. Would there be any timing limitations. Any clues?

sir can u please tell me how i can display a variable character . i m using vga.printPROGMEM function but it just work for constant character and i have to display a variable character , there is no function in vgax library for this … i am trying to display a integer variable counter value of 100 or 1000 range

Do you mean a variable glyph? That is, you want a different font or something? Or do you mean you want to display, using the same font, a variable?

actually i just want to display a variable

I like your VGAx library a lot
I made a little Stacker game with it
It uses only one button for control and has win/lose screens

Youtube video:

Are you going to release your BIT NINJA game’s sketch some day?
It would very interesting to see how this game works

stacker.ino (8.51 KB)

Hello to everyone! i have released a new Arduino library to generate VGA signals from an ESP8266:



512x480px monocromatic with line coloring!

This is the simple wiring needed:


Have fun!

smaffer: Hello to everyone! i have released a new Arduino library to generate VGA signals from an ESP8266:

512x480px monocromatic with line coloring!

Have fun!


Muchas gracias! ;)

Absolutely WOW Smaffer !! What an amazing update from your great VGAX (which I studied alot !!)

Just one question.. Did you consider running the ESP32VGAX on the second core as a full time task, and running another application on the first core ? unless I missed it, this looks like it just runs in normal core mode

Regards Bob

Hello Bob, thank you! this version of the library is for ESP8266 (single core). I don't know if can run on ESP32 (dual core). I am planning to buy a dev board with ESP32 and, in the future, test if the library works

Hi again, sorry I completely missed the bit where you wrote ESP8266, and just naturally assumed you were going for the big guy ! I am doing some projects with ESP32 and just about to start with dual core (but not video yet, but maybe one day)


Hello! I've released a new version of VGAX with ATMega2560 support. Resolution can be increased to 120x90px with squared pixels or 120x240px with rectangular pixels.

Video example of 120x240px on Arduino MEGA :)

Have fun!!

Hi, VGAXUA is now on GitHub! Is an alternative version of VGAX that use UART instead of bitbanging, inspired from the code of Nick Gammon. The library support 192x80px on Arduino UNO and 200x240px on Arduino MEGA!


Can i display serial data (serial monitor)? And if is posible please send me code...

Thank you!!