I have build a schematic for a VU-Meter with a PIC and a LCD. It works great but it is a little bit slow. May be someone is able to help me.
Here is the code to build the bargraph:
Code: Select all
......
Dim ADVUL as byte
Dim ADVUR as byte
....
Sub ADInAsVURect(value,sline,eline As Byte)
Dim x As Integer
For x = 1 To value
Rectangle (3*x+14,sline,3*x+15,eline)
Next
End Sub
Repeat
ADVUL = (ADC.Read(2)+1)/32
ADVUR = (ADC.Read(3)+1)/32
ADInAsVURect(ADVUL,17,20)
ADInAsVURect(ADVUL,24,27)
Until False
Until here it works great! But before I have to show new bars, I have to clear the area, and here is my problem. When I use for example Pen.Color = 0 and a For - Next to clear the area then the VU-Meter is very slow and doesn't look nice.
Can anybody give me a hint, how to clear the area as soon as possible?
Thanks in advance
Christian