User manual

def FillChar(code):
#fill the LCD display with a single ASCII character
#assumes a width of 15 characters x 4 lines = 60 chars total
for count in range(60):
UpdateCursor(count)
SendByte(code,True)
def CharTest(numCycles=4, delay=0.03):
#show screenfull of sequential symbols from character set
#starting with a random symbol
#delay = time between characters
LabelTest('Char')
for count in range(numCycles):
rand = random.randint(0,255)
firstChar = GetNextCharacter(rand)
FillScreen(firstChar,delay)
def NumberTest(delay=1):
#show an almost-full screen (60 chars) of each digit 0-9
#call with delay in seconds between each digit/screen
for count in range(10):
FillChar(ord('0')+count)
time.sleep(delay)
def TimeTest(numCycles=3):
#measures the time required to display 600 characters, sent
#60 characters at a time. The pause between screen displays
#is removed from the reported time.
pause = 0.5
LabelTest('Time')
for count in range(numCycles):
startTime = time.time()
NumberTest(pause)
elapsedTime = time.time()-startTime
elapsedTime -= pause*10
print " elapsed time (sec): %.3f" % elapsedTime
########################################################################
#
# Main Program
#
print "Pi LCD3 program starting."
InitIO()
InitLCD()
TimeTest()
CharTest()
AnimateCharTest()
print "Done."
# END ###############################################################