Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Private IsDark As Boolean
Private Zeile As Int
Private Spalte As Int
Private Color As Int
'Private Text As String = "abcdef" ' was shown on the Display !!
Private Text As String ' compiler accept this but no possibility to assign other strings to this Var
Public VGA_BLACK As Int = 0x0000
Public VGA_WHITE As Int = 0xFFFF
Public VGA_RED As Int = 0xF800
Public VGA_GREEN As Int = 0x0400
Public VGA_BLUE As Int = 0x001F
Public VGA_SILVER As Int = 0xC618
Public VGA_GRAY As Int = 0x8410
Public VGA_DarkGRAY As Int = 0xAD55
Public VGA_DimGRAY As Int = 0x6B4D
Public VGA_MAROON As Int = 0x8000
Public VGA_YELLOW As Int = 0xFFE0
Public VGA_OLIVE As Int = 0x8400
Public VGA_LIME As Int = 0x07E0
Public VGA_AQUA As Int = 0x07FF
Public VGA_TEAL As Int = 0x0410
Public VGA_NAVY As Int = 0x0010
Public VGA_FUCHSIA As Int = 0xF81F
Public VGA_PURPLE As Int = 0x8010
Public VGA_TRANSPARENT As Int = 0xFFFFFFFF
End Sub
'Private Text As String 'on this place unknown for the inline-code
Sub InitDisplay
RunNative("TftInit", Null)
IsDark = False
End Sub
Sub LowDisplay
RunNative("TftDark", Null)
IsDark = True
End Sub
Sub ToDisplay(xZeile As Int, xSpalte As Int, xText As String)
If IsDark Then
Color = VGA_DimGRAY
RunNative("TftSetBackColor", Null)
Else
Color = VGA_WHITE
RunNative("TftSetBackColor", Null)
End If
' here i need to assign the text to display
' -----------------------------------------
'Text = xText ' not possible for const
' -----------------------------------------
Spalte = 16 * (xSpalte-1)
Zeile = 16 * (xZeile-1)
RunNative("TftPrint", Null)
End Sub
Sub ToDisplayC(xZeile As Int, xSpalte As Int, xText As String,xColor As Int)
Color = xColor
Spalte = 16 * (xSpalte-1)
Zeile = 16 * (xZeile-1)
' here i need to assign the text to display
' -----------------------------------------
'Text = xText ' not possible for const
' -----------------------------------------
RunNative("TftSetBackColor", Null)
RunNative("TftPrint", Null)
Color = VGA_WHITE
RunNative("TftSetBackColor", Null)
End Sub
#If C
#include <UTFT.h>
extern uint8_t BigFont[];
UTFT myDisplay(TFT01_22SP,4,3,7,6,5);
void TftInit(B4R::Object* o) {
myDisplay.InitLCD();
myDisplay.setFont(BigFont);
myDisplay.fillScr(b4r_utft::_vga_white);
myDisplay.setColor(b4r_utft::_vga_black);
myDisplay.setBackColor(b4r_utft::_vga_white);
}
void TftDark(B4R::Object* o){
myDisplay.InitLCD();
myDisplay.setFont(BigFont);
myDisplay.fillScr(b4r_utft::_vga_dimgray);
myDisplay.setColor(b4r_utft::_vga_black);
myDisplay.setBackColor(b4r_utft::_vga_dimgray);
}
void TftSetBackColor(B4R::Object* o) {
myDisplay.setBackColor(b4r_utft::_color);
}
//void TftSetBackColorHell(B4R::Object* o) {
// myDisplay.setBackColor(255,255,255);
//}
//void TftSetBackColorDunkel(B4R::Object* o) {
// myDisplay.setBackColor(50,50,50);
//}
void TftPrint(B4R::Object* o) {
myDisplay.print(b4r_utft::_text->data,b4r_utft::_zeile,b4r_utft::_spalte,0);
}
#End If