PluginLCDProgrammableChrGenerator

Introduction

Here is a simple plugin for creating constant arrays of programmable characters for LCD displays.

LCDs support upto 8 programmable characters at any one time. To create each character, click on a pixel to invert it and drag over further pixels to set them to the same colour. The 'C' button below each character clears that character and the 'Invert' button inverts all of the pixels within the character.

The textbox below each character allows you to add a short description that will appear in the comment beside each row of the final constant array. Before pasting the final code into the Swordfish IDE, you may wish to change the 'Character set name' - this will become the name of the constant array. By exporting several constant arrays with different names, you can switch between several custom character sets in your final code.

Installing the Plugin

Download the plugin package below and run the installer program. This will install the application as a plugin.

Download LCD Programmable Chr Generator »

The plugin is built in Visual Basic 2008 Express. If you cannot run the plugin, you may need to install the DotNet framework from this link.

Example Code

The following simple code shows the use of custom characters.

Device = 18F452
Clock = 10

#option LCD_DATA = PORTB.4
#option LCD_RS = PORTB.2
#option LCD_EN = PORTB.3                                                                                                 
Include "LCD.bas"

Const GolfSymbols(64) As Byte = ($04,$0E,$1F,$0E,$0E,$0E,$0E,$00,   // LCD.Write(0) - Up
                                 $0E,$0E,$0E,$0E,$1F,$0E,$04,$00,   // LCD.Write(1) - Down
                                 $0E,$12,$15,$12,$16,$0C,$12,$00,   // LCD.Write(2) - Person
                                 $08,$0E,$0F,$0C,$08,$1A,$0C,$00,   // LCD.Write(3) - Flag
                                 $00,$00,$0C,$1E,$1E,$0C,$00,$00,   // LCD.Write(4) - +
                                 $00,$00,$00,$1E,$1E,$00,$00,$00,   // LCD.Write(5) - -
                                 $1E,$1F,$1B,$1F,$1E,$18,$18,$00,   // LCD.Write(6) - P
                                 $0E,$1F,$18,$0E,$03,$1F,$0E,$00)   // LCD.Write(7) - S

Const Progress(56) As Byte = ($0F,$10,$10,$10,$10,$10,$10,$0F,   // LCD.Write(0) - LH0
                              $0F,$10,$13,$13,$13,$13,$10,$0F,   // LCD.Write(1) - LH1
                              $1F,$00,$00,$00,$00,$00,$00,$1F,   // LCD.Write(2) - M0
                              $1F,$00,$18,$18,$18,$18,$00,$1F,   // LCD.Write(3) - M1
                              $1F,$00,$1B,$1B,$1B,$1B,$00,$1F,   // LCD.Write(4) - M2
                              $1E,$01,$01,$01,$01,$01,$01,$1E,   // LCD.Write(5) - RH0
                              $1E,$01,$19,$19,$19,$19,$01,$1E)   // LCD.Write(6) - RH1

LCD.Write(GolfSymbols)
LCD.Write(0,1,2,3,4,5,6,7)

DelayMS(2000)

LCD.Write(Progress)
LCD.Write(0,1,2,3,4,5,6," ")

Repeat
Until False

Importing Existing Character Sets

For simplicity, the plugin does not allow you to save a character set as such, but it does allow you to re-import a previously exported character set for further editing. You should highlight the whole of the constant array in the IDE and click the 'Import from Selected Text' in the plugin (see right).

You may then edit the characters as required and re-paste into the IDE, to overwrite the existing character set constant array.

If an error is encounterd when importing from the IDE, ensure that you have the whole of the existing constant array selected first.

Feedback

If you have any feedback regarding this plugin, please feel free to post it on the Swordfish forum.