#include "HardwareInfo.c"
#include "JMLib.c"
#include <SetLCDString.h>
#include <GetCompoI3.h>
#include <SetLCDBack.h>
#include <SetLCD3Char.h>
#include <GetButton1.h>
#include <GetButton2.h>
#include <GetButton3.h>
#include <SetTenthS.h>

// define global var
unsigned int g_0 = 0;

int main(void)
{
    X4RCU_Init();
    unsigned int var0 = 0;
    unsigned int btn1 = 0;
    unsigned int btn2 = 0;
    unsigned int num = 0;
    unsigned int btn3 = 0;
    unsigned char ch = '0';
    SetLCDString(0, 0, "A1", YELLOW, BLACK);
    var0 = GetCompoI3(_COMPOUNDEYE3_1_, 14);
    SetLCDString(8, 128, "Modulate   ", YELLOW, BLACK);
    SetLCDBack(1);
    SetLCDString(8, 64, "Max:", YELLOW, BLACK);
    SetLCDString(8, 80, "Min:", YELLOW, BLACK);
    SetLCDString(8, 96, "Average:", YELLOW, BLACK);
    while (1)
    {
        var0 = GetCompoI3(_COMPOUNDEYE3_1_, 1);
        SetLCD3Char(0, 0, var0, YELLOW, BLACK);
        var0 = GetCompoI3(_COMPOUNDEYE3_1_, 2);
        SetLCD3Char(40, 0, var0, YELLOW, BLACK);
        var0 = GetCompoI3(_COMPOUNDEYE3_1_, 3);
        SetLCD3Char(80, 0, var0, YELLOW, BLACK);
        var0 = GetCompoI3(_COMPOUNDEYE3_1_, 4);
        SetLCD3Char(120, 0, var0, YELLOW, BLACK);
        var0 = GetCompoI3(_COMPOUNDEYE3_1_, 5);
        SetLCD3Char(160, 0, var0, YELLOW, BLACK);
        var0 = GetCompoI3(_COMPOUNDEYE3_1_, 6);
        SetLCD3Char(200, 0, var0, YELLOW, BLACK);
        var0 = GetCompoI3(_COMPOUNDEYE3_1_, 7);
        SetLCD3Char(240, 0, var0, YELLOW, BLACK);
        var0 = GetCompoI3(_COMPOUNDEYE3_1_, 8);
        SetLCD3Char(72, 64, var0, YELLOW, BLACK);
        var0 = GetCompoI3(_COMPOUNDEYE3_1_, 9);
        SetLCD3Char(112, 64, var0, YELLOW, BLACK);
        var0 = GetCompoI3(_COMPOUNDEYE3_1_, 10);
        SetLCD3Char(72, 80, var0, YELLOW, BLACK);
        var0 = GetCompoI3(_COMPOUNDEYE3_1_, 11);
        SetLCD3Char(112, 80, var0, YELLOW, BLACK);
        var0 = GetCompoI3(_COMPOUNDEYE3_1_, 12);
        SetLCD3Char(72, 96, var0, YELLOW, BLACK);
        btn1 = GetButton1();
        if ( btn1==1 )
        {
            var0 = GetCompoI3(_COMPOUNDEYE3_1_, 13);
            num=1;btn1=0;
            SetLCDString(8, 128, "UnModulate", YELLOW, BLACK);
        }
        btn2 = GetButton2();
        if ( btn2==1 )
        {
            var0 = GetCompoI3(_COMPOUNDEYE3_1_, 14);
            num=2;btn2=0;
            SetLCDString(8, 128, "Modulate    ", YELLOW, BLACK);
        }
        btn3 = GetButton3();
        if ( btn3==1 )
        {
            var0 = GetCompoI3(_COMPOUNDEYE3_1_, 15);
            num=3;btn3=0;
            SetLCDString(8, 128, "15         ", YELLOW, BLACK);
        }
        SetTenthS(2);
    }
    while(1);
}

