LCD Bargraph with different styles: Unterschied zwischen den Versionen

Aus ProjectWiki
Wechseln zu:Navigation, Suche
(Created page with "== How to use it == In the top of your main program, just add these lines: Const Lcd_bar_style = 1 $include "..\inc\lcd_bar.bas" To draw the Bargraph on the LCD: Locat...")
 
(Sample)
 
(6 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 2: Zeile 2:
  
 
In the top of your main program, just add these lines:
 
In the top of your main program, just add these lines:
   Const Lcd_bar_style = 1
+
   Const Lcd_bar_style = [Style]
   $include "..\inc\lcd_bar.bas"
+
   $include "lcd_bar.bas"
  
 
To draw the Bargraph on the LCD:
 
To draw the Bargraph on the LCD:
 
   Locate [x] , [y]
 
   Locate [x] , [y]
 
   Lcd_bar [value] , [x-size]
 
   Lcd_bar [value] , [x-size]
 +
  
 
== Sample ==
 
== Sample ==
  
 
Main File:
 
Main File:
  $regfile = "m32def.dat"
+
<pre>
  $crystal = 16000000
+
$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
  
  $hwstack = 32
+
Cls
   $swstack = 16
+
Do
   $framesize = 32
+
   Locate 1 , 2
 +
   Lcd_bar Value , 14
  
   $sim
+
   Value = Value + 2
 +
  If Value = 102 Then Value = 0
  
   Config Lcd = 16 * 2
+
   'Waitms 50
 +
Loop
 +
End
 +
</pre>
  
  Const Lcd_bar_style = 1
+
This simply draws a bar with a size of 14 characters at the position [1, 2] and sweeps from 0-100%.
  $include "..\inc\lcd_bar.bas"
 
  
  Dim Value As Byte
+
== What it looks like ==
 +
Use
 +
<pre>Const Lcd_bar_style = [Style]</pre>
 +
with one of the styles listed below:
  
  Cls
+
[[File:lcd_bar_styles.jpg|Bar styles]]
  
  Do
+
[[File:lcd_character_table.png|width|400px|Character Table]]
      Locate 1 , 1
+
Style 4 only uses standard characters.
      Lcd_bar Value , 5
 
      Value = Value + 2
 
      If Value = 102 Then Value = 0
 
      'Waitms 50
 
  Loop
 
  
This simply draws a bar at the position 1, 1 and sweeps from 0-100%.
+
== Download ==
  
== What it looks like ==
+
[http://www.braunecker.at/downloads/lcd_bar_1_0.zip LCD Bar 1.0 (.zip)]

Aktuelle Version vom 15. Juni 2011, 01:24 Uhr

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:

Bar styles

Character Table Style 4 only uses standard characters.

Download

LCD Bar 1.0 (.zip)