User manual
for count in range(numCycles):
for step in range(15):
for col in range(15):
x = col+step
VBar(sine[x%15],col)
time.sleep(0.2)
def IncrementVBar(col,height):
#increaase the number of vertical bars by one
fullChars = height / 8
bars = height % 8
ShowBars(3-fullChars,col,bars+1)
def DecrementVBar(col,height):
#decrease the number of vertical bars by one
height -= 1
fullChars = height / 8
bars = height % 8
ShowBars(3-fullChars,col,bars)
def AnimatedVBar(col,newHeight,oldHeight=0):
diff = newHeight - oldHeight
for count in range(abs(diff)):
if diff>0:
IncrementVBar(col,oldHeight)
oldHeight +=1
else:
DecrementVBar(col,oldHeight)
oldHeight -=1
time.sleep(ANIMATIONDELAY)
def AnimatedVBarTest(numCycles=4):
LoadSymbolBlock(verticalBars)
LabelTest('VBar')
graph = [0]*15
for count in range(numCycles):
for col in range(15):
height = random.randint(1,32)
AnimatedVBar(col,height,graph[col])
graph[col] = height
########################################################################
#
# Main Program
#
print "Pi LCD4 program starting.”
InitIO() #Initialization
InitLCD()
ClearDisplay()
CharTest()
TimeTest() #Basic LCD Tests
AnimateCharTest()
HBarTest() #Horizontal Graph Tests
AnimatedHBarTest()
VBarTest() #Vertical Graph Tests
AnimatedVBarTest()
SineGraph()
BigClock() #Something actually useful
# END #############################################################