Interfacing Arduino With VGA Monitor
Interfacing Arduino With VGA Monitor
This post shows how to connect VGA monitor with Arduino UNO board in order to draw
shapes (lines, circles …) and print texts with resolution of 160×64 pixel.
VGA: Video Graphics Array
Hardware required:
Arduino UNO board
VGA monitor
2 x 68 ohm resistor
220 ohm resistor
VGA connector
Breadboard
Jumper wires
Color pins (R: red, G: green, B: blue) of the VGA connector (respectively #1, #2 and #3)
are connected together in order to get white and black colors, they are connected to
Arduino digital pin 7.
The first library is a simple and small library for generating the required signals (VSYNC,
HSYNC and video).
The VSYNC (vertical synchronization) signal is generated on pin 10.
The HSYNC (horizontal synchronization) signal is generated on pin 3.
The video signal is generated on pin 7.
This library disables Timer0 interrupt which means the following functions will not work
anymore:
unsigned millis();
unsigned long micros();
void delay(ms);
void delayMicroseconds(us);
Instead of delay(ms) function the VGA library has an other one with the same name.
After the download of the library, put its files (VGA.h and VGA.ccp) in Arduino
sketch folder.
The VGA library works with Adafruit graphics library which can be downloaded
from the following link:
Adafruit graphics library —-> direct link
/*************************************************************************
*
* VGA output with Arduino (white and black colors).
* This is a free software with NO WARRANTY.
* https://simple-circuit.com/
*
************************************************************************/
void setup(void) {
// initialize the VGA display
display.begin();
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0, 0);
display.println("Hello, world!");
display.setTextColor(BLACK, WHITE);
display.println(3.141592);
display.setTextSize(2);
display.setTextColor(WHITE);
display.print("0x");
display.println(0xDEADBEEF, HEX);
display.setCursor(0, 40);
display.setTextSize(1);
display.print("Arduino VGA Example");
}
void loop() {
;
}
// end of code.