STC15F2K60S2单片机读写ADS1256并LCD1602显示驱动程序源码,可以做为你的学习设计参考。
void main()
{
signed long Adc;
float Volts;
DelayMs(50);
ADS1256_Init(); //ADS1256 参数初始化
LCD_Init();
while(1)
{
Adc = ADS1256ReadData( ADS1256_MUXP_AIN0|ADS1256_MUXN_AINCOM);
Volts = Adc*0.00059453; // 0.00000059453 为系数,ADC生产出后都有一定的偏差,在此校准。
display_num4(LINE1_COLUMN(1),Volts);
delay_ms(100);
Adc = ADS1256ReadData( ADS1256_MUXP_AIN1|ADS1256_MUXN_AINCOM);
Volts = Adc*0.00059453; // 0.00000059453 为系数,ADC生产出后都有一定的偏差,