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 Text As String
'Private Text() As Byte
Private Zeile As Int
Private Spalte As Int
Private Color As Int
End Sub
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
RunNative("TftSetBackColorDunkel", Null)
Else
RunNative("TftSetBackColorHell", Null)
Text.GetBytes(xText)
Spalte = 16 * (xSpalte-1)
Zeile = 16 * (xZeile-1)
RunNative("TftPrint", Null)
End If
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(255,255,255);
myDisplay.setColor(0,0,0);
myDisplay.setBackColor(255,255,255);
}
void TftDark(B4R::Object* o){
myDisplay.InitLCD();
myDisplay.setFont(BigFont);
myDisplay.fillScr(50,50,50);
myDisplay.setColor(0,0,0);
myDisplay.setBackColor(50,50,50);
}
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,b4r_utft::_zeile,b4r_utft::_spalte,0);
}
#End If