User manual
if diff>0:
IncrementHBar(row,startCol,oldLength)
oldLength +=1
else:
DecrementHBar(row,startCol,oldLength)
oldLength -=1
time.sleep(ANIMATIONDELAY)
def AnimatedHBarTest(numCycles=8):
LoadSymbolBlock(horizontalBars)
LabelTest('HBar')
graph = [0,0,0,0]
for count in range(numCycles):
for row in range(4):
length = random.randint(1,60)
GotoXY(row,0)
ShowMessage("%2d" % length)
AnimatedHBar(row,3,length,graph[row])
graph[row] = length
########################################################################
#
# Vertical Graph Testing Routines
#
def ClearVBar(col):
#remove all elements on a vertical bar
for row in range(4):
GotoXY(row,col)
SendByte(0x20,True)
def VBar(height,col):
#creates a vertical bar at specified column
#expects height of 1 (min) to 32 (max)
#Must load vertical bar symbols prior to calling
fullChars = height / 8
bars = height % 8
row = 3
ClearVBar(col)
for count in range(fullChars):
ShowBars(row,col,8)
row -= 1
if bars>0:
ShowBars(row,col,bars)
def VBarTest(numCycles=4):
LoadSymbolBlock(verticalBars)
LabelTest('Vert')
for count in range(numCycles):
for col in range(15):
height = random.randint(1,32)
VBar(height,col)
time.sleep(1)
def SineGraph(numCycles=4):
#print a sin wave function using vertical bars.
#this is a sample application of the VBar routine.
#the 'sine' list emulates the following formula:
#radians=x*2*math.pi/15; y = math.sin(radians)*15 + 16
sine = [16,22,27,30,31,29,25,19,13,7,3,1,2,5,10]
LoadSymbolBlock(verticalBars)
LabelTest('Sine')