Code:
' Testprog glcd
$regfile = "m16def.dat"
$hwstack = 128
$swstack = 128
$framesize = 128
$crystal = 16000000
$baud = 19200
Baud = 19200
'First we define that we use a graphic LCD
Config Graphlcd = 240 * 128 , Dataport = Porta , Controlport = Portb , Ce = 2 , Cd = 3 , Wr = 0 , Rd = 1 , Reset = 4 , Fs = 5 , Mode = 8
Declare Sub Tacho(nr As Byte , Xcenter As Byte , Ycenter As Byte , Radius As Byte , Maxval As Long , Aktval As Long)
Const Black = 255
Const X1 = 200
Const Y1 = 100
Const R1 = 20
Dim Xc As Byte
Xc = 60
Dim Yc As Byte
Yc = 70
Dim Rr As Byte
Rr = 50
Dim Nn As Byte
Nn = 1
Dim Vmax As Long
Vmax = 200
Dim Vakt As Long
Vakt = 200
Cls
Cursor Off , No Blink
Call Tacho(nn , Xc , Yc , Rr , Vmax , Vakt)
Wait 1
Circle(xc , Yc) , Rr , Black ' Ok, draw a circle
End 'end program
Sub Tacho(nr As Byte , Xcenter As Byte , Ycenter As Byte , Radius As Byte , Maxval As Long , Aktval As Long)
Circle(xcenter , Ycenter) , Radius , Black ' failed, one dot at Coordinate X=YCenter, Y=0 (radius=0 ?)
Circle(30 , 30) , 20 , Black ' Ok, draw a circle
Circle(x1 , Y1) , R1 , Black ' OK, draw a circle
End Sub
Lesezeichen