def display_temp(rgb): global Matrix #light up "TEMP" m = mapping_matrix.getMatrix() for t in range(4): pixels[int(m[0][t + 8])] = (255, 255, 255) #light up "OUTSIDE" m = mapping_matrix.getMatrix() for o in range(7): pixels[int(m[10][o + 5])] = (255, 255, 255) # light up numerical temperature for j in range(12): for k in range(12): if (Matrix[k][j] == 1): pixels[int(m[k][j])] = rgb pixels.show()
def disp_clear_middle(): time_mode.clear_middle() for j in range(12): for k in range(9): m = mapping_matrix.getMatrix() # create mapping matrix if k == 8 and j <= 3: pixels[int(m[9][j])] = (0, 0, 0) elif k != 8: pixels[int(m[k + 1][j])] = (0, 0, 0) pixels.show()
def disp_flag(): m = mapping_matrix.getMatrix() for r in range (12): for c in range(12): if c <= 3: pixels[int(m[r][c])] = (0, 255, 0) elif c <= 7: pixels[int(m[r][c])] = (255, 255, 255) else: pixels[int(m[r][c])] = (255, 0, 0) pixels.show();
def disp_time(): time_mode.set_base_words() time_mode.set_hour(time_mode.getHour()) time_mode.set_minutes(time_mode.getMinutes()) time_mode.set_day(time_mode.getDay()) for j in range(12): for k in range(12): m = mapping_matrix.getMatrix() # create mapping matrix if (time_mode.Matrix[k][j] == 1): pixels[int(m[k][j])] = (255, 255, 255) if (time_mode.Matrix[k][j] == 2): pixels[int(m[k][j])] = (255, 0, 0) pixels.show()
def disp_snake(): #pixels.fill((0,0,0)) #pixels.show() for k in range(len(snake)): snake_x = get_x(snake[k]) snake_y = get_y(snake[k]) Matrix[snake_x][snake_y] = 1 m = mapping_matrix.getMatrix() if k == 0: pixels[int(m[snake_x][snake_y])] = (255, 255, 255) else: pixels[int(m[snake_x][snake_y])] = (0, 255, 0) pixels.show() for i in range(12): for j in range(12): if Matrix[i][j] == 2: pixels[int(m[i][j])] = (255, 0, 0) pixels.show()
def clear_snake_end(): m = mapping_matrix.getMatrix() l = snake[len(snake) - 1] pixels[int(m[get_x(l)][get_y(l)])] = (0, 0, 0) pixels.show()