© ArduTV 2025

ArduTV - TV Interface shield for Arduino.

Privacy Policy

Arduino Library Reference

Here you can find instruction to work with ArduTV board using Arduino boards. 

First at all you need to install the ArduTV library in the Arduino IDE (same process of any other library).

You can download the library here: /downloads/library

Please have a look to the example projects in the "Project Examples",too.

ArduTV needs three steps in the code to be used:

1) Declare an "ArduTV" variable with the Chip Select pin to be used by SPI interface with the following command:  ArduTV AnyName(10);      --> (10 is the default pin for CS)

where AnyName is any name.

2) Start the ArduTV board with the following command: 

AnyName.begin();

where  AnyName is any name (same as declared in the point 1).

3) Use the following commands to create your projects:

PenColor(u8 red,u8 green,u8 blu);

PenColorDir(u16 color);

Clear(void);

Point(u16 CoordinateX,u16 CoordinateY);

PointDir(u16 CoordinateX,u16 CoordinateY,u16 Color);

Rect(u16 CoordinateX,u16 CoordinateY,u16 Larghezza,u16 Altezza,u16 fill);

Circle(u16 CoordinateX,u16 CoordinateY,u16 Raggio);

printchar(const char str, int x, int y,u8 scale);

BGColor(u8 red,u8 green,u8 blu);

printString(const char* str, int x, int y,u8 scale);

changeFont(u8 ind, u8 font[8]);

General

PenColor (u8 red,u8 green,u8 blu); 
The function is used to set the color of the track used in all the commands except for PointDir. The color is defined by mixing RED, GREEN and BLU channel with an intensity between 0 to 31. The Black color is defined by (0,0,0) and the white color by (31,31,31).

PenColorDir(u16 color);
The function (alternative to PenColor command) is used to set the color of the track used in all the commands except for PointDir. The color is defined by a single 16 bit unsigned number representing the color in bits with the following meaning: Bit 15--> don't care, Bit 14-10--> RED, Bit 9-5-->GREEN, Bit 4-0-->BLU

Clear(void);
The function clear the screen using the color defined by BGColor command.

Point(u16 CoordinateX,u16 CoordinateY);
The function draws a single pixel dot in the coordinate X and Y of the screen using the color defined by  PenColor or  PenColorDir.

PointDir(u16 CoordinateX,u16 CoordinateY,u16 Color);
The function draws a single pixel dot in the coordinate X and Y of the screen using the color defined by the parameter Color of the function based on  a single 16 bit unsigned number with the following meaning: Bit 15--> don't care, Bit 14-10--> RED, Bit 9-5-->GREEN, Bit 4-0-->BLU


Rect(u16 CoordinateX,u16 CoordinateY,u16 Larghezza,u16 Altezza,u16 fill);
The function draws a rectangle starting at the coordinate X and Y of the screen of length defined by Larghezza and width defined by Altezza using the color defined by  PenColor or PenColorDir. The parameter fill defines if the rectangle is filled by color (using "1") or not (using "0")

Circle(u16 CoordinateX,u16 CoordinateY,u16 Raggio);
The function draws a circle with the center at the coordinate X and Y of the screen and ray defined by Raggio parameter  using the color defined by PenColor or PenColorDir.

printchar(const char str, int x, int y,u8 scale);
The function prints a single character defined by str at the coordinate X and Y  using the color defined by PenColor or PenColorDir. The parameter scale defines the scale of the character (i.e. 1 is 8x8 bit character, 2 is 16x16 3 is 32x32 and so on...).
Note: The color settled by  BGColor command defines the background of the character.

BGColor(u8 red,u8 green,u8 blu);
The function is used to define the background color of the screen (and of the background of characters). The color is defined by mixing RED, GREEN and BLU channel with an intensity between 0 to 31. The Black color is defined by (0,0,0) and the white color by (31,31,31).


printString
(const char* str, int x, int y,u8 scale);

The function prints a string of characters defined by str at the coordinate X and Y using the color defined by PenColor or PenColorDir. The parameter scale defines the scale of the character (i.e. 1 is 8x8 bit character, 2 is 16x16, 3 is 32x32 and so ...).
Note: The color settled by BGColor command defines the background of the character.

changeFont(u8 ind, u8 font[8]);
This function is used to insert a different font inside the memory of ArduTV. The command change one character at the time. It is not mandatory to change all the character set, you could decide just to change 1 or few characters.
The used font by ArduTV is 8 lines of 8 bits (8x8 character).
The "ind" parameter indicates the ASCII code of the character to be modified.  
The font[8] is an array of 8 unsigned byte containing the 8 lines of the new character. Once the new character is inserted in the memory the old character is overwritten and any string used after this replacement will use the new character.
To restore the old character set just power off the board and then power up it again. Please visit the example projects to know more.
NOTE: The font set is stored inside ArduTV internal memory (no memory consumption on Arduino board). The font change is possible only during runtime, it is not possible to change the start-up default font set. 

© ArduTV 2025

Privacy Policy