#include "delay.h"
#include "sys.h"
#include "lcd.h"
#include "key.h"
#include "ads1115.h"
int MainDisplayChinese(void);
int main(void)
{
u8 i,m;
float t1;
u16 t,result;
u8 d=0;
u8 e=0;
u8 key=0;
u16 ADValue1,ADValue2,ADValue3,ADValue4;
KEY_Init();
delay_init();
NVIC_Configuration();
Lcd_Init();
delay_init();
LCD_Clear(WHITE);
ADS1115_Init();
//BACK_COLOR=GREEN;
//BACK_COLOR_SEL=GREEN;
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
LCD_ShowPicture_st(84,44,233,193);
delay_ms(5000);
LCD_Clear(WHITE);
MainDisplayChinese();
while(1)
{
LCD_ShowString(0,35,"CH1:",BLUE);
LCD_ShowString(0,65,"CH2:",BLUE);
LCD_ShowString(0,95,"CH3:",BLUE);
LCD_ShowString(0,125,"CH4:",BLUE);
result=lvbo(0xe3,0xc2);
t1=10000*4.096*2*result/65535;
t=t1;
LCD_ShowNum(40,35,t1,6,RED);
result=lvbo(0xe3,0xd2);
t1=10000*4.096*2*result/65535;
t=t1;
LCD_ShowNum(40,65,t1,6,RED);
result=lvbo(0xe3,0xe2);
t1=10000*4.096*2*result/65535;
t=t1;
LCD_ShowNum(40,95,t1,6,RED);
result=lvbo(0xe3,0xf2);
t1=10000*4.096*2*result/65535;
t=t1;
LCD_ShowNum(40,125,t1,6,RED);
}
}
int MainDisplayChinese(void)
{
LCD_Fill(0,0,320,30,RED);
Display_GB2312_String(48,5,2,"四通道电压采集系统",BLUE,RED);
// LCD_ShowPicture(180,80,239,139);
}
|