##
# @file    main.py
# @brief   LED Test
# @version 1.0
#

import gui
import ft8xx as ft
import vts


def redraw_cb(b):
    red_num[0] = red_sl[0]
    green_num[0] = green_sl[0]
    blue_num[0] = blue_sl[0]
    vts.leds(red_num[0],green_num[0],blue_num[0],red_num[0],green_num[0],blue_num[0],red_num[0],green_num[0],blue_num[0],red_num[0],green_num[0],blue_num[0])

# LED's can be set with a red, green, blue value from 0-255
red_num = [0]
green_num = [0]
blue_num = [0]
red_sl = [25]
green_sl = [25]
blue_sl = [25]


gui.show([
    [gui.PARAM_CLRCOLOR, 0],
    [gui.EVT_REDRAW, redraw_cb],
    [gui.CTRL_TEXT, 90, 40, 29, 0, 'Red'],
    [gui.CTRL_NUMBER, 300, 40, 29, 0, '', red_num],
    [gui.CTRL_SLIDER, 50, 90, 700, 20, 0xff, red_sl],
    [gui.CTRL_TEXT, 90, 200, 29, 0, 'Green'],
    [gui.CTRL_NUMBER, 300, 200, 29, 0, '', green_num],
    [gui.CTRL_SLIDER, 50, 250, 700, 20, 0xff, green_sl],
    [gui.CTRL_TEXT, 90, 360, 29, 0, 'Blue'],
    [gui.CTRL_NUMBER, 300, 360, 29, 0, '', blue_num],
    [gui.CTRL_SLIDER, 50, 410, 700, 20, 0xff, blue_sl],
])

gui.redraw()
