User manual
LoadSymbolBlock(digits)
posn = [0,3,7,10,14,17]
ClearDisplay()
ShowColon(6)
ShowColon(13)
for count in range(seconds):
tStr = time.strftime("%I%M%S")
for i in range(len(tStr)):
value = int(tStr[i])
symbols = bigDigit[value]
ShowBigDigit(symbols,posn[i])
time.sleep(1)
########################################################################
#
# Basic HD44780 Test Routines
# Code here is used in higher-level testing routines
#
ANIMATIONDELAY = 0.02
def LabelTest(label):
#Label the current Test
ClearDisplay()
GotoXY(1,20-len(label)); ShowMessage(label)
GotoXY(2,16); ShowMessage('test')
def CommandTest():
LabelTest('Command')
while (True):
st = raw_input("Enter a string or command: ")
if len(st)==2:
SendByte(int(st,16))
elif len(st)==1:
SendByte(int(st),True)
else:
ShowMessage(st)
def AnimateCharTest(numCycles=8,delay=ANIMATIONDELAY):
LabelTest('Animation')
LoadSymbolBlock(battery) #get all battery symbols
GotoXY(1,6) #where to put battery
for count in range(numCycles):
for count in range(len(battery)): #sequence thru all symbols
SendByte(count,True) #display the symbol
CursorLeft() #keep cursor on same char
time.sleep(delay) #control animation speed
time.sleep(1) #wait between cycles
def ShowBars(row,col,numBars):
#displays a graph symbol at row,col position
#numBars = number of horizontal (or vertical bars) in this symbol
#expected values = 0 to 7 (vertical) or 0 to 4 (horizontal)
GotoXY(row,col)
if numBars==0:
SendChar(' ')
else:
SendByte(numBars-1,True)
########################################################################
#
# Alphanumberic Testing Routines