You are on page 1of 7
PRACTICAL NO. & | Aion : Displaying Time over 16X2 LCD Display using Raspbary Pi. ||Requirements: Rasplenny Pi, Miow SD cand. 16x 2 LCO unit yen pind. Brwadboand . jumper vsints BNP Assembling the 16x2 LCD — " If Furst, snap the header pins, -4e-you hase {line of 16. 12+ Pha.ce he header pins up through dhe hel of the display. | The ghost side op the header pine shod gtbck up ___ (3 Now using o hot Joldening juen and seme selden, tout Wfaetasn_sach ny the pins __ —— 4 T8 now ouddy por use Connections = Sana Wwe de het want Sv feeding back inte the Pil Pi's GPIO pang ame sated 3V ) We wilh need de make the sead/ woute pan ef tue LCD ge te ground. Following are the steps whine the physical /Angical numboung of the pins ane in the bra ucels Qtheuulse 13 the GPLO runmibertng St John Ci s and Sciences | - ES | Place a wine fom Sv (Pin 2) de he pSSLVe ail en the breadboard ss 2 Plaw a wine from yours Eins the _qapund seiy on the brwadboand 2. Plate the lex2 display ente the (ruadboand Connecr Ane pesitive and quousd “pins te the nelwant SLAMS onthe breadboard. ____— __ = Starting yuom pint of the LCD ‘dispoy ae the Jouning —— Pin | ws of the scowen Js tha Ee — dhe, baad. 2) fei nA Pint (-coound) goss ae the qpound id at i | Pun 2 eter ve src! Peephebe Pin 3 (vo) goes $9 Pin 4 (RS) geese GPTO2S (Ain22d. Pans CRW )_gisea ste the ground suai Pun 6 LEN) gqser_p_GPLO Pi Pun ti C04) gee se GPI023 ( Pin Rin 14 COT) quoes to GPIO22 Chins) Pan's (LED +) ques te Ant peautive odie Pin 16 ( LED-) gee 19 the gtound Scud Source Code : impos RPI. GPLO a3 Lmpose Lune sige A # Dayne GPIO te LCD mapping —_____ LCOD-R9=26 —— LoD = 19 cs bep- DY =j3 Lep-pS= 6 HT sas Meee LCD-D6é=¢5 ab oT Lop. D?= Ll als ER SES 4 One, Lep cmp = Folie | aay main 6) 2 ted init O- 1H # Ours some doe venston nace pa Lint Lep_ width +16 # Madmum Chora Pp Len. CHR = True Ist Ung cb Linet1.2 0x80 ff LcD RAM adda Yo aes a o tt LCD RAM addy fo-2 icp — LInE2=2= Ox6 _# Taming usnst ons = || e puLse = 0.0005 — _E-DELAY = 0- 00S _ i i Fayfe ) _$¥s it cl GPIO- -Bcm) _# Use Bom GPLO sum | eto. setup Chop. £ @pro.out) 8 E GPTO- setup (14D. RS_GPLO.ouT) HRS PIO: Seupl icp 04, GPro.ovT) _t DBL GPLo. Setup (1eD-DS, Plo. ouT) _f DBS _ || GPTo. Setup (LD 06. GPLo-ovD # DBE GPO. sekup { Lep- PT, GPTo.ovT) i 0B7_ Si John College of Humanities and Sciences H Inttalie display cd Lyte (0x33. LCD. CMD) cd bye Coxn32. Leo cd byte Cox06, Led AD) ded ~ byte (0x0C, LCD-cMD) Lid ~ byte (0x28, LCD cmp) acd byte ( Oxo, Lep_cmd) dime. sleep (E_ DELAY ) day Lcd- sbung ( Massage. style) oi gtiple = = Trassage = masage - Ajust ( LED- WIDTH, ) Aly stype = = 2 mmusage = muwage. conta CLeD—WwidTH.” *) aly style = = O92. sjust CLed width, ) & ; -wtange ( Led WiilDTH) eit Led lyre Lord | menage Lid), Leo. cH er) E [doy ed toys Chita, mode) __ Lo GPT. output (1cD-Rs, mode) HRS — || —_ ft High bia ___ + _ Gro. oudput (LeD_D4, Fause) ir —_GPTo. output (rcp- Ps, False) _ PLO. output ( Lop Dé. False) GPTo. output ( LCD D7, Falie) St. John College of Humanities and Sciences ap bola 2 O x10 == 0x10 GPro outpw ( LED D4. Tru? aj bata 20x20 0x20 Gpro.curpus ( rcD- DS Tru ) iy bits 20x 40 == Ox 4D- : GPIO output (eco Dé, True) . wij buts 20x80 = = 0x60 Gero. ocurpwt (LCD. PT Tra) E i # Toggte Enabte’ Pan did toggu - enable) i = dow bing y 7 = oto oui cD fa) _GPTo. oukpuk (Lep-pS. False) St. John College of Humanities and Sciences doy Lod. toggle znatote () # Togqis snatte ume. Aiep ( 6 DELAY) GPlo. ourput L LCD_E , Tate ) ime. alexp CE PULSE) GPLO. outpus ( Lep-E, Fuser) Juine. seep ( E_ DELAY) CPLO. ceanup () Execution’ Bpan Python IDLE usm Pooqyonoming oplion awoLotAe oF PL Tren

You might also like