Download ACS Color 320 x 240 LCD Basic Programming
Transcript
ACS Color 320 x 240 LCD Basic Programming Manual 8 September 2014 Don’t Get Boxed In If you look at the Extended Characters table at the end of the manual, there are some that can be used for line drawing. Let’s try and draw a simple box. We need the four corners, the lines across the top and bottom and the lines on the side. Try typing this short program in – don’t forget to NEW first: 10000 10005 10010 10015 10020 10025 10030 10035 10040 10045 10050 10055 10060 10065 10070 10075 REM Draw a box using ANSI characters PRINT CHR$(226); CHR$(148); CHR$(140); FOR I=1 TO 10 PRINT CHR$(226); CHR$(148); CHR$(128); NEXT I PRINT CHR$(226); CHR$(148); CHR$(144) PRINT CHR$(226); CHR$(148); CHR$(130); FOR I = 1 TO 10 PRINT " "; NEXT I PRINT CHR$(226); CHR$(148); CHR$(130) PRINT CHR$(226); CHR$(148); CHR$(148); FOR I=1 TO 10 PRINT CHR$(226); CHR$(148); CHR$(128); NEXT I PRINT CHR$(226); CHR$(148); CHR$(152) And now RUN it: run ┌──────────┐ │ │ └──────────┘ Ready save ansibox Ready If it works as shown then you can save it for later. Now you’re probably asking yourself why are the line numbers so large? The large line numbers allow us to come back later and put some lower-numbered lines before these. In this example they’re going to let us save some typing. Character Rules 1. 2. 3. 4. 5. Characters are actually a displayed version of a single number. The first 128 characters (numbers 0 – 127) have been agreed upon and are referred to as the ASCII character set. Refer to http://www.asciitable.com There is a built-in function, CHR$( ) that can convert a numeric argument into a character. Additional extended characters may be displayed using multiple character prefix codes. Using Basic PRINT commands on the display is known as ANSI operation. Copyright©2010-2014 by ACS, Sarasota, Florida 43 ALL RIGHTS RESERVED