Skip to content

Instantly share code, notes, and snippets.

@jblang
Created November 27, 2018 18:53
Show Gist options
  • Save jblang/7a15497a0c37fb376ab8ed102046322f to your computer and use it in GitHub Desktop.
Save jblang/7a15497a0c37fb376ab8ed102046322f to your computer and use it in GitHub Desktop.
AppleSoft BASIC program to control an LCD
10 IR = 47104: REM CONTROL REGISTER $B800
20 DR = 47360: REM DATA REGISTER $B900
30 GOSUB 100
40 INPUT "WHAT DO YOU WANT TO PRINT? ";S$
50 GOSUB 200
60 END
100 REM INITIALIZE LCD
110 FOR I = 1 TO 4
120 POKE IR,56: REM 8-BIT BUS, 5X8 FONT, 2 LINES
130 NEXT I
140 POKE IR,6: REM LEFT-TO-RIGHT MODE
150 POKE IR,14: REM DISPLAY ON
160 POKE IR,1: REM CLEAR DISPLAY
170 RETURN
200 REM OUTPUT STRING S$ TO LCD
210 POKE IR,128
220 FOR I = 1 TO LEN (S$)
230 C = ASC(MID$(S$,I))
240 POKE DR,C
250 NEXT I
260 RETURN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment