![]() |
PicoVGA
1.0-cmake
VGA/TV display on Raspberry Pico
|
PICOVGA_PATH
to the PicoVGA directory in your environment, or pass it (-DPICOVGA_PATH=
) to cmake later.The PicoVGA project comes with a comprehensive set of example programs that demonstate many of the features of the library. These examples are located in the examples
folder of the PicoVGA project.
To create the makefiles, run this CMake command from the main PicoVGA folder:
Then to build all the example projects at once, you run make (please note this might take a long time):
This will generate a .uf2
file for every example program in the root folder of each example.
If you want to build a single example program, you can run make for just that example:
If you don't want to mix the build files with the rest of the code, you can specify a separate build folder when running CMake:
This will generate all the makefiles and build outputs into the build
folder.
After you build one or more example files, the compiled output will be generated as program_name.uf2
file where program_name
is the name of the example. They are compiled for a VGA monitor and USB serial keyboard input. Load them into the Pico by copying the uf2
on the Pico when it's in bootloader mode (hold the bootsel button when connecting to your computer).
Many of the examples use a USB serial connection for controls.
The easiest way to incorporate the PicoVGA library into a project is to examine or copy the sample project.
To add PicoVGA to an existing project you must do the following:
picovga_import.cmake
file from the PicoVGA library folder into the root of your project.vga_config.h
file from the the PicoVGA library folder into the source or include files folder in your project.CMakeLists.txt
file: add_picovga()
macro in the CMakeLists.txt
file: vga_config.h
is included in the target include directories in CMakeLists.txt
: Run the command cmake .
to generate the makefiles for the project and make
to build the project.
The vga_config.h
contains the PicoVGA library settings, such as the size of the render buffers. You usually do not need to pay attention to this file. You usually only have to modify it in the following cases:
If you have an older monitor that requires VGA VSync, uncomment the line the CMakeLists.txt
file that sets the vsync pin:
Vsync can use any pin on the Pico (the default is 9)