I'm back and it seems that I haven't understand everything right. Here is some code, wich makes a little flicker on the display and that's it.
At the bottom of the display is a backgroundpicture shown with an arrow on the left and on the right side. In the middle should stand the menu point. When I press the RB1 or RB2 then the display flicker alittle bit but shows nothing. Where is the misstake?
Code: Select all
Device = 18F452
Clock = 20
#option GLCD_MODEL = SED1520
Include "GLCD.bas"
Include "Fonts.bas"
Include "Bitmaps.bas"
Include "FixedFont.bas"
Include "Convert.bas"
Dim RES As PORTC.4,
INT0 As INTCON.1,
INT1 As INTCON3.0,
INT2 As INTCON3.1,
SETUP As Boolean,
aktMenu As Byte
Const DegreeSymbol = 127,
Background(248) As Byte = ($01,122,11,0,$FF,$DF,$8F,$57,$DB,$DF,$DF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$DF,$DF,$DB,$57,$8F,$DF,$FF,
$07,$07,$07,$07,$06,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$07,$06,$07,$07,$07,$07),
MenuPoints(5) As String = ("Point 1", Point 2", "Point 3","Point 4","Point 5")
interrupt Switches()
If INT0 = 1 Then
INT0 = 0
End If
If INT1 = 1 Then
If aktMenu < Bound(MenuPoints) Then
Dec(aktMenu)
ElseIf aktMenu = Bound(MenuPoints) Then
aktMenu = 0
End If
SetFont(Fixed)
TextAlign = taCenter
Font.Style = 3
WriteStr(61,22,MenuPoints(aktMenu))
INT1 = 0
End If
If INT2 = 1 Then
If aktMenu > 0 Then
Inc(aktMenu)
ElseIf aktMenu = 0 Then
aktMenu = Bound(MenuPoints)
End If
SetFont(Fixed)
TextAlign = taCenter
Font.Style = 3
WriteStr(61,22,MenuPoints(aktMenu))
INT2 = 0
End If
End interrupt
Sub PrepareDisplayFrame()
Rectangle(0,0,121,21)
SetImage(0,21,Background,0)
End Sub
RCON = 0 ' Disable Interrupt priority
INTCON = %10010000 ' Enable all unmasked interrupts; External Interrupt Int0 enabled
INTCON2 = %01110000 ' External Interrups 0,1,2 at rising edge
INTCON3 = %00011000 ' External Interrupt INT2 enabled
TRISB = 1
High(RES)
SETUP = false
aktMenu = 0
Cls
PrepareDisplayFrame
While true
Wend