| Swordfish Tutorial - LCD |
|
|
| Saturday, 04 April 2009 08:18 | |
|
Swordfish has many built in libraries, one being "LCD.bas". This library allows seemingly easy control of LCD modules, and only requires a few declarations.
Click here to see this circuit in action!
Note that the contrast resistor pot can be anything from 4.7K to 10K, and that the unused data lines on the LCD do not need to be tied to earth. Be sure to allow a small delay before sending data/commands to the LCD module on startup, as its microprocessor has to initialize as well. 150mS should be enough for most devices.
Device = 18F4520 Clock = 20 // some LCD options... #option LCD_DATA = PORTD.4 // Assign the LCD connections #option LCD_EN = PORTD.3 // #option LCD_RS = PORTD.2 // // import LCD library... Include "LCD.bas" Include "convert.bas" Dim Variable As Word // Start Of Program... DelayMS(150) // Let the LCD warm up LCD.Cls // Clear the LCD screen LCD.WriteAt(1,1,"Hello World") // Send some text to the LCD Variable = 0 // Clear the "Variable" register While True Inc(Variable) // Increment the "Var1" register // Convert to a string, // and always display 5 characters LCD.WriteAt(2,1,Convert.DecToStr(Variable,5)) DelayMS(1000) // Delay for 1 second Wend
Video Tutorials
Video tutorial on how to Mod an LCD for breadboards and use them
|
|
| Last Updated ( Friday, 24 April 2009 10:22 ) |
Whos Online
- dha
- ta1dr
- Jon Chandler
Forum Activity
Credit Where Credit's Due - jon chandler Tuesday, 16 March 2010 12:01 - [9 replies]
Marching LEDs - mrdeb Saturday, 13 March 2010 22:54 - [7 replies]
USB 8 Channel Servo Controller - andyo Saturday, 13 March 2010 01:19 - [2 replies]
Dedicated Servo Controller - graham Friday, 12 March 2010 17:58 - [0 replies]
Must have....delta temperature glowies! - graham Friday, 12 March 2010 17:31 - [3 replies]
A 'throw-away" PIC board - jon chandler Friday, 12 March 2010 13:41 - [31 replies]
iHID - graham Friday, 12 March 2010 02:04 - [5 replies]





Gamers ought to know link:http://www.buyazugagold.com [azuga gold[/u...]
Graham, Thanks for fixing the spacing on the array. This is how i...
Thanks Graham, It is a problem with Flowcode because the demo wa...
Looks like you've pretty much solved every minor issue that was enc...
The low-cost servo does have one other feature. The origina...
I am not familiar with flowcode, though did you try powering the bo...
Hello there, I am still trying to get the LCD to work but I am pro...
Hi Hop, I've finally got some time this weekend to delve into the ...