Dim Zwischenspeicher As Word
Dim Neu As Word
Zwischenspeicher = 0
Do
Neu = Volt
Call Lcd_draw_dia(zwischenspeicher , Neu)
Zwischenspeicher = Neu
loop
end
Sub Lcd_draw_dia(byval Alt As Word , Neu As Word)
'Lcd_set_pixel(byval X1 As Word , Y1 As Word , Color As Word)
Const Start_x = 30
Const Start_y = 30
Const End_x = 210
Const End_y = 310
Local Pointer_x As Word
Pointer_x = 30
Local I As Word
'Local Alt As Word
'Local Neu As Word
Local Mitte As Integer
Local Richtung As Integer
'*Koordinatenkreuz zeichnen
Call Lcd_h_line(30 , 240 , 30 , White)
Call Lcd_v_line(30 , 320 , 30 , White)
'##########################
Call Lcd_set_pixel(Alt ,pointer_x , White)
Mitte = Neu - Alt
Shift Mitte , Right , 1 , Signed 'Diff = Diff / 2
Mitte = Mitte + Alt
Richtung = -1
If Neu > Alt Then
Richtung = 1
End If
I = Alt + Richtung
While I <> Mitte 'i ungleich mitte |hier wird die erste Hälfte gezeichnet
Call Lcd_set_pixel(I ,pointer_x , White)
I = I + Richtung
Wend
Incr Pointer_x 'erhöhe pointer_x um eins
While I <> Neu 'i ungleich mitte |und nun die zweite Hälfte
Call Lcd_set_pixel(i , Pointer_x , White)
I = I + Richtung
Wend
Call Lcd_set_pixel(Neu ,pointer_x , White)
End Sub