Some News:
- I have released version 1.1 with support for Arduino Print Class on BlueVGA.
- It's possible to print to the screen in the same way as Serial.print() and Serial.println()
- Thus the VGA Monitor can work as an output monitor for Arduino Sketches!
- It scrolls the screen automatically when printing on the last line or when wrapping text in the last line as well.
- It understands '\n' (new line) '\r' (carriage return) and '\t' (tab) - number of columns used for TAB can be configured by code
- Print Class and all variations of print() and println() work on both official STM32 Core and Roger's Core as well.
Example of usage:
Code: Select all
#include "bluevga.h"
#include "font.h"
BlueVGA vga(ASCII_FONT); // starts VGA driver using bitmap array ASCII_FONT
// There is also a 'printTest.ino' file that can be found in the library examples
void setup() {
vga.setTextCursor(0, 1); // position cursor at x = 0 and y = 1 (second line) in the screen
vga.print("Hello World\t\t"); // it supports all Arduino ways for println() and understands '\t' as tab, default 4 columns
vga.print("tab space\n"); // it also understands '\n' as new line and '\r' as carriage return in the same line
vga.setTextWrap(false); // it allows to wrap or not text when printing beyond right margin of the screen
vga.setTextTab(3); // it allows to set number of columns for TAB ('\t')
vga.setTextColor(RGB_GREEN, RGB_BLACK); // it allows to define foreground (green) and background (black) colors for further printing
vga.print(3.1415, 3); // it works as Arduino does, printing floats witn any number of decimal digits
uint8_t color = vga.getTextColor(); // gets current printing colors in format 8 bits rgb0rgb0 BGColor 4 bits followed by FGColor 4 bits
uint8_t x = vga.getTextCursorX(); // gets current X cursor position
uint8_t y = vga.getTextCursorY(); // gets current Y cursor position
vga.scrollText(3); // it scrolls the screen up 3 lines. No change on current cursor position. Just scrolls text and its colors!
for(uint32_t i=0;;i++) { // prints numbers for ever and scrolls the screen when reaching last line
vga.print("value of i is ");
vga.println(i);
vga.waitVSync(); // waits to end of VGA frame drawing routine to end -- makes the image to stay solid
}
}