LCD Bargraph with different styles: Unterschied zwischen den Versionen
Aus ProjectWiki
Mat (Diskussion | Beiträge) (→Download) |
Mat (Diskussion | Beiträge) (→Sample) |
||
(Eine dazwischenliegende Version desselben Benutzers wird nicht angezeigt) | |||
Zeile 30: | Zeile 30: | ||
Cls | Cls | ||
Do | Do | ||
− | Locate 1 , | + | Locate 1 , 2 |
− | Lcd_bar Value , | + | Lcd_bar Value , 14 |
− | Value = Value + | + | Value = Value + 2 |
− | If Value = | + | If Value = 102 Then Value = 0 |
'Waitms 50 | 'Waitms 50 | ||
Zeile 41: | Zeile 41: | ||
</pre> | </pre> | ||
− | This simply draws a bar at the position [1, | + | This simply draws a bar with a size of 14 characters at the position [1, 2] and sweeps from 0-100%. |
− | |||
== What it looks like == | == What it looks like == | ||
Zeile 56: | Zeile 55: | ||
== Download == | == Download == | ||
− | [http://www.braunecker.at/downloads/lcd_bar_1_0.zip | + | [http://www.braunecker.at/downloads/lcd_bar_1_0.zip LCD Bar 1.0 (.zip)] |
Aktuelle Version vom 15. Juni 2011, 01:24 Uhr
Inhaltsverzeichnis
How to use it
In the top of your main program, just add these lines:
Const Lcd_bar_style = [Style] $include "lcd_bar.bas"
To draw the Bargraph on the LCD:
Locate [x] , [y] Lcd_bar [value] , [x-size]
Sample
Main File:
$regfile = "m32def.dat" $crystal = 16000000 $hwstack = 32 $swstack = 16 $framesize = 32 $sim Config Lcd = 16 * 2 Const Lcd_bar_style = 1 $include "..\inc\lcd_bar.bas" Dim Value As Byte Cls Do Locate 1 , 2 Lcd_bar Value , 14 Value = Value + 2 If Value = 102 Then Value = 0 'Waitms 50 Loop End
This simply draws a bar with a size of 14 characters at the position [1, 2] and sweeps from 0-100%.
What it looks like
Use
Const Lcd_bar_style = [Style]
with one of the styles listed below:
Style 4 only uses standard characters.