Fixed a few minor issues in 4DGL library Moved pc serial port object used for debug output into 4DGL object itself. Previously it was a global object but its constructor wasn't getting run before the global constructor for the 4DGL object itself which led to an assert in the serial code. I also fixed a few potential buffer overruns that I saw in the code as well.

Embed: (wiki syntax)

« Back to documentation index

TFT_4DGL Class Reference

TFT_4DGL Class Reference

Example: More...

#include <TFT_4DGL.h>

Public Member Functions

void cls ()
 Clear the entire screen using the current background colour.
void reset ()
 Reset screen.
void autobaud ()
 Launch Autobaud for serial communication.
void baudrate (int speed)
 Set serial Baud rate (both sides : screen and mbed)
void background_color (int color)
 Set background colour to the specified value.
void display_control (char mode, char value)
 Set screen display mode to specific values.
void set_volume (char value)
 Set internal speaker to specified value.
void circle (int x, int y, int radius, int color)
 Draw a circle centered at x,y with a radius and a colour.

Detailed Description

Example:

 // Display a white circle on the screen
 #include "mbed.h"
 #include " TFT_4DGL.h"
 
 TFT_4GDL myLCD(p9,p10,p11);
 
 int main() {
     myLCD.circle(120, 160, 80, WHITE);
 }

Definition at line 173 of file TFT_4DGL.h.


Member Function Documentation

void autobaud (  )

Launch Autobaud for serial communication.

This function is automatically called at startup

Definition at line 121 of file TFT_4DGL_main.cpp.

void background_color ( int  color )

Set background colour to the specified value.

Parameters:
colorin HEX RGB like 0xFF00FF

Definition at line 257 of file TFT_4DGL_main.cpp.

void baudrate ( int  speed )

Set serial Baud rate (both sides : screen and mbed)

Parameters:
SpeedCorrect BAUD value (see TFT_4DGL.h)

Definition at line 143 of file TFT_4DGL_main.cpp.

void circle ( int  x,
int  y,
int  radius,
int  color 
)

Draw a circle centered at x,y with a radius and a colour.

It uses Pen Size stored value to draw a solid or wireframe circle

Parameters:
xHorizontal position of the circle centre
yVertical position of the circle centre
radiusRadius of the circle
colorCircle color in HEX RGB like 0xFF00FF

Definition at line 25 of file TFT_4DGL_Graphics.cpp.

void cls (  )

Clear the entire screen using the current background colour.

Definition at line 128 of file TFT_4DGL_main.cpp.

void display_control ( char  mode,
char  value 
)

Set screen display mode to specific values.

Parameters:
modeSee 4DGL documentation
valueSee 4DGL documentation

Definition at line 273 of file TFT_4DGL_main.cpp.

void reset (  )

Reset screen.

Definition at line 110 of file TFT_4DGL_main.cpp.

void set_volume ( char  value )

Set internal speaker to specified value.

Parameters:
valueCorrect range is 8 - 127

Definition at line 301 of file TFT_4DGL_main.cpp.