9:26 am
Hi.
I am new Arduino and this forum, but not LabVIEW.
This is my first post, so please let me know if I have not correctly followed any of the forum protocols!
I need to define some custom characters within an LCD module (SainSmart 4 line).
In addition to writing the bit pattern to the LCD Data Registers, this task also requires that the "Set CGRAM Address" is written to the Instruction Register, immediately before the data.
Control Instruction differ from Data by having the RS bit set to 0 for Instructions Registers, and 1 for Data Registers.
I have not been able to find a way to do this using the LCD functions supplied.
Please could someone tell me the correct way to approach this?
Many thanks
Regards
AK
2:18 pm
March 12, 2015
Is this an I2C LCD? The SainSmart LCD is usually I2C based, which the I2C module takes care of the RS Bit control for you. Either way, custom characters may only be possible by creating your own Arduino library wrapper. We can take a look if there is another workaround, just let us know which specific LCD you are using.
2:34 pm
Hi Steffan. Many thanks for the prompt reply.
The LCD module is a Sainsmart, 4 line module, Part No. 2004A, with 8574A I2C Interface.
I have successfully written a LabVIEW "bit-banging" program to communicate with it via a USB to I2C interface ISS
(one of these... https://www.robot-electronics......s_tech.htm ),
and I expect that I could port this to the Arduino, but it would be much more elegant, and may help other users if there was an LCD control function to handle this on the LV Arduino function pallette.
Any suggestions would be very much appreciated.
Thanks for a great product!
Regards
AK
5:20 pm
March 12, 2015
Ok, that is the standard I2C LCD that is supported by the Compiler. The Arduino library that is used does implement a custom character API. However, this has not been implemented as part of the Compiler. I agree, this would be a good addition to the palette. There should be a simple way to create an addon that only implements the custom character functionality though. I have an LCD here so will try to mock up an addon that implements this. Will get back to you.
3:36 pm
Hi Steffan. Thanks for the VIs which worked perfectly!
The application was to draw a horizontal bar graph on the Sainsmart 2004A with 1% resolution.
This was achieved by defining 6 characters in the CGRAM locations 0 to 5. The character in location 0 was blank (no pixels illuminated), and each successive character is 1 pixel wider, with location 5 being a solid illuminated block.
I have attached the VIs which I hope will save others users some work.
I have also attached a broken VI, to show how it cannot be done! (perhaps you could tell me why this one breaks?)
Thanks again for the help. 5 star support!
AK7466
21
1 Guest(s)