The first part of the code (setting up all the modules and such), works perfectly without error. However when it starts the while statements, it all goes wrong
Thanks in advance!
Code: Select all
while lightValue < 20000:
control.key = input(ap.show_message("Good evening Tim! Use the joystick to select a variable to measure: Left = Temperature Right = Humidity and Up = Pressure", text_colour=[208, 108, 245])
if control.key == K_LEFT:
if temp < 5: # Temperature is measured in degrees celsius
ap.set_pixels(redlow)
while temp >= 5 and <= 7:
ap.set_pixels(p125)
while temp >= 8 and <= 11:
ap.set_pixels(p25)
while temp >= 12 and <= 15:
ap.set_pixels(p375)
while temp >= 16 and <= 18:
ap.set_pixels(p50)
while temp >= 19 and <= 22:
ap.set_pixels(p625)
while temp >= 23 and <= 26:
ap.set_pixels(p75)
while temp >= 27 and < 30:
ap.set_pixels(p875)
while temp == 30:
ap.set_pixels(p100)
while temp > 30:
ap.set_pixels(redhigh)