Hallo!
In diesem Bereich geht es um allgemeine Dinge für fertige Controllermodule mit farbigen Grafikdisplay.
Hier mal der Ausschnitt für ein Codebeispiel für ein kleines 1,5" Grafikdisplay.
Wie dieses Codestück dann auf dem Display aussieht, kann man im angehängten Bild sehen.
Gruß,
Cassio
In diesem Bereich geht es um allgemeine Dinge für fertige Controllermodule mit farbigen Grafikdisplay.
Hier mal der Ausschnitt für ein Codebeispiel für ein kleines 1,5" Grafikdisplay.
Code:
Bgwt1 = Blau
Bgwt2 = Gelb
Bgwt3 = Rot
Ztag = Dayofweek()
' ------------------------------------------------------------------------------
Lcd_string = Date$ ' Datum im Header
Lx1 = 2
Ly1 = 1
Fontsize = 1
Lcd_fcolor = Blau
Lcd_bcolor = Weiss
Gosub Lcd_print
Lcd_string = Time$ ' Zeit im Header
Lx1 = 14
Ly1 = 1
Fontsize = 1
Lcd_fcolor = Blau
Lcd_bcolor = Weiss
Gosub Lcd_print
Lcd_string = " " ' Leerzeichen
Lx1 = 1
Ly1 = 3
Fontsize = 0
'Lcd_fcolor = Blau
Lcd_bcolor = Blau
Gosub Lcd_print
Lcd_string = "Mo" ' Wochentag
Lx1 = 2
Ly1 = 3
Fontsize = 0
If Ztag = 0 Then
Lcd_fcolor = Bgwt3
Lcd_bcolor = Bgwt2
Else
Lcd_fcolor = Bgwt2
Lcd_bcolor = Bgwt1
End If
Gosub Lcd_print
Lcd_string = " " ' Leerzeichen
Lx1 = 4
Ly1 = 3
Fontsize = 0
'Lcd_fcolor = Blau
Lcd_bcolor = Blau
Gosub Lcd_print
Lcd_string = "Di" ' Wochentag
Lx1 = 5
Ly1 = 3
Fontsize = 0
If Ztag = 1 Then
Lcd_fcolor = Bgwt3
Lcd_bcolor = Bgwt2
Else
Lcd_fcolor = Bgwt2
Lcd_bcolor = Bgwt1
End If
Gosub Lcd_print
Lcd_string = " " ' Leerzeichen
Lx1 = 7
Ly1 = 3
Fontsize = 0
'Lcd_fcolor = Blau
Lcd_bcolor = Blau
Gosub Lcd_print
Lcd_string = "Mi" ' Wochentag
Lx1 = 8
Ly1 = 3
Fontsize = 0
If Ztag = 2 Then
Lcd_fcolor = Bgwt3
Lcd_bcolor = Bgwt2
Else
Lcd_fcolor = Bgwt2
Lcd_bcolor = Bgwt1
End If
Gosub Lcd_print
Lcd_string = " " ' Leerzeichen
Lx1 = 10
Ly1 = 3
Fontsize = 0
'Lcd_fcolor = Blau
Lcd_bcolor = Blau
Gosub Lcd_print
Lcd_string = "Do" ' Wochentag
Lx1 = 11
Ly1 = 3
Fontsize = 0
If Ztag = 3 Then
Lcd_fcolor = Bgwt3
Lcd_bcolor = Bgwt2
Else
Lcd_fcolor = Bgwt2
Lcd_bcolor = Bgwt1
End If
Gosub Lcd_print
Lcd_string = " " ' Leerzeichen
Lx1 = 13
Ly1 = 3
Fontsize = 0
'Lcd_fcolor = Blau
Lcd_bcolor = Blau
Gosub Lcd_print
Lcd_string = "Fr" ' Wochentag
Lx1 = 14
Ly1 = 3
Fontsize = 0
If Ztag = 4 Then
Lcd_fcolor = Bgwt3
Lcd_bcolor = Bgwt2
Else
Lcd_fcolor = Bgwt2
Lcd_bcolor = Bgwt1
End If
Gosub Lcd_print
Lcd_string = " " ' Leerzeichen
Lx1 = 16
Ly1 = 3
Fontsize = 0
'Lcd_fcolor = Blau
Lcd_bcolor = Blau
Gosub Lcd_print
Lcd_string = "Sa" ' Wochentag
Lx1 = 17
Ly1 = 3
Fontsize = 0
If Ztag = 5 Then
Lcd_fcolor = Bgwt3
Lcd_bcolor = Bgwt2
Else
Lcd_fcolor = Bgwt2
Lcd_bcolor = Bgwt1
End If
Gosub Lcd_print
Lcd_string = " " ' Leerzeichen
Lx1 = 19
Ly1 = 3
Fontsize = 0
'Lcd_fcolor = Blau
Lcd_bcolor = Blau
Gosub Lcd_print
Lcd_string = "So" ' Wochentag
Lx1 = 20
Ly1 = 3
Fontsize = 0
If Ztag = 6 Then
Lcd_fcolor = Bgwt3
Lcd_bcolor = Bgwt2
Else
Lcd_fcolor = Bgwt2
Lcd_bcolor = Bgwt1
End If
Gosub Lcd_print
Lcd_string = " " ' Leerzeichen
Lx1 = 22
Ly1 = 3
Fontsize = 0
'Lcd_fcolor = Blau
Lcd_bcolor = Blau
Gosub Lcd_print
' ------------------------------------------------------------------------------
Lx1 = 1 ' obere waagerechte
Ly1 = 28
Lx2 = 130
Ly2 = 28
Color = Blau
Gosub Lcd_draw
Lx1 = 1 ' mittlere waagerechte
Ly1 = 71
Lx2 = 130
Ly2 = 73
Color = Blau
Gosub Lcd_box
Lx1 = 1 ' mittlere weiße waagerechte
Ly1 = 72
Lx2 = 132
Ly2 = 72
Color = Weiss
Gosub Lcd_draw
Lx1 = 1 ' untere waagerechte
Ly1 = 117
Lx2 = 130
Ly2 = 117
Color = Blau
Gosub Lcd_draw
' ------------------------------------------------------------------------------
Lx1 = 1 ' linke Linie
Ly1 = 28
Lx2 = 1
Ly2 = 117
Color = Blau
Gosub Lcd_box
Lx1 = 64 ' mittlere Linie
Ly1 = 28
Lx2 = 66
Ly2 = 117
Color = Blau
Gosub Lcd_box
Lx1 = 65 ' mittlere weiße Linie
Ly1 = 26
Lx2 = 65
Ly2 = 118
Color = Weiss
Gosub Lcd_draw
Lx1 = 130 ' rechte Linie
Ly1 = 28
Lx2 = 130
Ly2 = 117
Color = Blau
Gosub Lcd_box
' ------------------------------------------------------------------------------
Lcd_string = "DCF_sec" ' DCF-sec
Lx1 = 3
Ly1 = 3
Fontsize = 1
Lcd_fcolor = Blau
Lcd_bcolor = Weiss
Gosub Lcd_print
Lcd_string = Time(dcf_sec)
Lx1 = 2
Ly1 = 4
Fontsize = 1
Lcd_fcolor = Rot
Lcd_bcolor = Weiss
Gosub Lcd_print
' ------------------------------------------------------------------------------
Lcd_string = "Dcf_day" ' Dcf_day
Lx1 = 14
Ly1 = 3
Fontsize = 1
Lcd_fcolor = Blau
Lcd_bcolor = Weiss
Gosub Lcd_print
Lcd_string = Date(dcf_day)
Lx1 = 13
Ly1 = 4
Fontsize = 1
Lcd_fcolor = Rot
Lcd_bcolor = Weiss
Gosub Lcd_print
' ------------------------------------------------------------------------------
Lcd_string = "Sectic" ' Sekundenpuls
Lx1 = 14
Ly1 = 6
Fontsize = 1
Lcd_fcolor = Blau
Lcd_bcolor = Weiss
Gosub Lcd_print
' Sectic-Kästchen 16x16 siege oben !
If Puls = 1 Then
Lx1 = 92 ' Box-Anzeige 12x12
Ly1 = 100
Lx2 = 104
Ly2 = 112
Color = Rot
Gosub Lcd_box
Else
Lx1 = 92 ' Box-Anzeige 12x12
Ly1 = 100
Lx2 = 104
Ly2 = 112
Color = Weiss
Gosub Lcd_box
End If
' ------------------------------------------------------------------------------
Lcd_string = "Statusbit" ' dcf_status
Lx1 = 2
Ly1 = 6
Fontsize = 1
Lcd_fcolor = Blau
Lcd_bcolor = Weiss
Gosub Lcd_print
Lcd_string = "2:" ' dcf_status
Lx1 = 2
Ly1 = 7
Fontsize = 1
Lcd_fcolor = Blau
Lcd_bcolor = Weiss
Gosub Lcd_print
Lcd_string = "7:" ' dcf_status
Lx1 = 7
Ly1 = 7
Fontsize = 1
Lcd_fcolor = Blau
Lcd_bcolor = Weiss
Gosub Lcd_print
If Dcf_status.2 = 1 Then
Lx1 = 21 ' Status-Kästchen
Ly1 = 99
Lx2 = 27
Ly2 = 111
Color = Rot
Gosub Lcd_box
Else
Lx1 = 21 ' Status-Kästchen
Ly1 = 99
Lx2 = 27
Ly2 = 111
Color = Weiss
Gosub Lcd_box
End If
If Dcf_status.7 = 1 Then
Lx1 = 51 ' Status-Kästchen
Ly1 = 99
Lx2 = 57
Ly2 = 111
Color = Rot
Gosub Lcd_box
Else
Lx1 = 51 ' Status-Kästchen
Ly1 = 99
Lx2 = 57
Ly2 = 111
Color = Weiss
Gosub Lcd_box
End If
' ------------------------------------------------------------------------------
Lcd_string = " Clock updates: "
Lx1 = 1
Ly1 = 16
Fontsize = 0
Lcd_fcolor = Rot
Lcd_bcolor = Weiss
Gosub Lcd_print
Sync_zs = Str(sync_z)
Sync_zs = Format(sync_zs , "00000")
Lcd_string = Sync_zs
Lx1 = 17
Ly1 = 16
Fontsize = 0
Lcd_fcolor = Rot
Lcd_bcolor = Weiss
Gosub Lcd_print
Wie dieses Codestück dann auf dem Display aussieht, kann man im angehängten Bild sehen.
Gruß,
Cassio