20x4 LCD Display with Raspberry Pi
25 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
I try on displaying Text on a 20x4 LCD Screen through a Raspberry Pi 3b+. (My goal is writing a standalone program for the Raspberry)
I already have the Raspberry Toolboy for Matlab but I can't find any commands on how to display the Text.
Thanks in advance!
0 commentaires
Réponses (1)
Shantanu Thatte
le 25 Juin 2021
Hi Niklas,
To interface with a 20x4 LCD with Rasperry Pi using MATLAB, you will have to first download and install the Raspberry Pi Support Package. Once that's done you will have to use either I2C or SPI bus to read/write data to your LCD. You will have to refer to the datasheet of your LCD to find which interface types your LCD supports.
If I assume that you have to use I2C to inteface with the LCD then you can use the write function to write to the I2C address. There is a more detailed example available on that page, but briefly:
% Assuming mypi is your raspberry pi
% Get instance of the conenction to I2C device at address 0x55
i2cdisplay = i2cdev(mypi,'i2c-1','0x55')
% Now write to the display
write(i2cdisplay,[hex2dec('20') hex2dec('51')])
% Or to write to a register (register 3 here)
writeRegister(i2cdisplay,3,hex2dec('08'),'uint8')
Voir également
Catégories
En savoir plus sur Raspberry Pi Hardware dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!