User manual
character set, 0xE0 is an a-grave (à).
#determine the character set
SendByte(0x01) #clear the display
SendByte(0xE0,True) #Either alpha (A0) or a-grave (A2)
Does your controller chip have A0 or A2? Now, just for fun, let’s fill up the display with
characters. I set up this routine for 4 rows of 15 characters each, giving me extra space for
a text label.
def FillChar(code):
for count in range(60):
UpdateCursor(count)
SendByte(code,True)
def UpdateCursor(count):
if count==0:
GotoLine(0)
elif count=15:
GotoLine(1)
elif count=30:
GotoLine(2)
elif count=45:
GotoLine(3)
Now try a call to FillChar(0xE0), and watch your display fill up with alphas. UpdateCursor
makes sure that you go from line to line at the appropriate times. Rather inelegant looking,
isn’t it? How about something more compact?
def UpdateCursor(count):
if (count%15)==0:
GotoLine(count/15)
Is this any better? I stuck with the first version, because it is fast, straightforward and easy
to understand. You choose!
Finally, let’s mix it up a bit and display more of the character set. You can sequence
though all 255 character codes, but there are two large empty blocks in A0 that don’t have
characters. A function for getting the next available character will get rid of those empty
blocks:
def GetNextCharacter(code):
if (code<0x20) or (code>=0xFF): #remove first empty block
code = 0x20
elif (code>=0x7F) and (code<0xA0): #remove second empty block
code = 0xA0
else:
code += 1 #OK to get next character
return code
Now create a routine that looks like FillChar, except for an added call to GetNextCharacter.
To slow down the action, delay after each character for a fraction of a second:
def FillScreen(code,delay=0):
for count in range(60):
UpdateCursor(count)