-
:):time:
-
晨曦清茗 发表于 2015-12-20 20:11
ADResult1 = (( ADResult0 * 3) / 4096);你这个地方/是整数,前两次的分母要是小于分子的话,相除(/)的 ...
那应该怎么计算它的值?你说的问题实际上是取余了,所以会是0对吧?
-
:):):)
-
谢谢你:)
-
:)挺好
-
谢谢楼主分享:):)
-
谢谢楼主的分享:):)
-
:):loveliness::victory:
-
:victory::loveliness::hug:谢谢
-
本帖最后由 paulhyde 于 2014-9-15 03:22 编辑 /***************************************************************************** 文件名:AD_CAIYANG.C* 功能:使用AD采集电压显示在LCD* 说明:转自网络,本人验证通过****************************************************************************/#include#define uint unsigned int#define uchar unsigned char sbit CS=P2^0; //LCD12864串行通信片选sbit SID=P2^1; //LCD12864串行通信数据口sbit SCLK=P2^2; //LCD12864串行通信同步时钟信号sbit PSB=P2^5; //LCD12864并/串选择:H并行L串行 unsigned int temp1,sh1,ge1,n1,m1;unsigned char ad_result_data[10]; //AD转换高八位unsigned char ad_result_low2[10]; //AD转换低八位unsigned char ad_result_total[10]; //AD转换总十位unsigned char ad_average_result; //AD转换十次的平均值unsigned char Ain,Vin;unsigned char b,t,R;char tp=0;unsigned char codema1[6]={0xb5,0xe7,0xd1,0xb9,0xa1,0xc3}; //电压:unsigned char code ma2[]={"."};uchar code disp1[]={"提示: 按1 键进入"};uchar code disp2[]={"功能选择界面. "};unsigned char code num0[]={0xa3,0xb0};unsigned char code num1[]={0xa3,0xb1};unsigned char code num2[]={0xa3,0xb2};unsigned char code num3[]={0xa3,0xb3};unsigned char code num4[]={0xa3,0xb4};unsigned char code num5[]={0xa3,0xb5};unsigned char code num6[]={0xa3,0xb6};unsigned char code num7[]={0xa3,0xb7};unsigned char code num8[]={0xa3,0xb8};unsigned char code num9[]={0xa3,0xb9}; //-------模块延时程序----------------------------1msvoid delay1ms(uint delay1ms) //STC11F60XE,22.1184M,延时1ms{uint i,j; for(;delay1ms>0;delay1ms--) for(i=0;i
-
本帖最后由 paulhyde 于 2014-9-15 03:22 编辑 /****************************************************************************
* 文件名:AD_CAIYANG.C
* 功能:使用AD采集电压显示在LCD
* 说明:转自网络,本人验证通过
****************************************************************************/
#include
#define uint unsigned int
#define uchar unsigned char
sbit CS=P2^0; //LCD12864串行通信片选
sbit SID=P2^1; //LCD12864串行通信数据口
sbit SCLK=P2^2; //LCD12864串行通信同步时钟信号
sbit PSB=P2^5; //LCD12864并/串选择:H并行 L串行
unsigned int temp1,sh1,ge1,n1,m1;
unsigned char ad_result_data[10]; //AD转换高八位
unsigned char ad_result_low2[10]; //AD转换低八位
unsigned char ad_result_total[10]; //AD转换总十位
unsigned char ad_average_result; //AD转换十次的平均值
unsigned char Ain,Vin;
unsigned char b,t,R;
char tp=0;
unsigned char code ma1[6]={0xb5,0xe7,0xd1,0xb9,0xa1,0xc3}; //电压:
unsigned char code ma2[]={"."};
uchar code disp1[]={"提示: 按1 键进入"};
uchar code disp2[]={"功能选择界面. "};
unsigned char code num0[]={0xa3,0xb0};
unsigned char code num1[]={0xa3,0xb1};
unsigned char code num2[]={0xa3,0xb2};
unsigned char code num3[]={0xa3,0xb3};
unsigned char code num4[]={0xa3,0xb4};
unsigned char code num5[]={0xa3,0xb5};
unsigned char code num6[]={0xa3,0xb6};
unsigned char code num7[]={0xa3,0xb7};
unsigned char code num8[]={0xa3,0xb8};
unsigned char code num9[]={0xa3,0xb9};
//-------模块延时程序---------------------------- 1ms
void delay1ms(uint delay1ms) //STC11F60XE,22.1184M,延时1ms
{
uint i,j;
for(;delay1ms>0;delay1ms--)
for(i=0;i
-
本帖最后由 paulhyde 于 2014-9-15 03:22 编辑 /****************************************************************************
* 文件名:AD_CAIYANG.C
* 功能:使用AD采集电压显示在LCD
* 说明:转自网络,本人验证通过
****************************************************************************/
#include
#define uint unsigned int
#define uchar unsigned char
sbit CS=P2^0; //LCD12864串行通信片选
sbit SID=P2^1; //LCD12864串行通信数据口
sbit SCLK=P2^2; //LCD12864串行通信同步时钟信号
sbit PSB=P2^5; //LCD12864并/串选择:H并行 L串行
unsigned int temp1,sh1,ge1,n1,m1;
unsigned char ad_result_data[10]; //AD转换高八位
unsigned char ad_result_low2[10]; //AD转换低八位
unsigned char ad_result_total[10]; //AD转换总十位
unsigned char ad_average_result; //AD转换十次的平均值
unsigned char Ain,Vin;
unsigned char b,t,R;
char tp=0;
unsigned char code ma1[6]={0xb5,0xe7,0xd1,0xb9,0xa1,0xc3}; //电压:
unsigned char code ma2[]={"."};
uchar code disp1[]={"提示: 按1 键进入"};
uchar code disp2[]={"功能选择界面. "};
unsigned char code num0[]={0xa3,0xb0};
unsigned char code num1[]={0xa3,0xb1};
unsigned char code num2[]={0xa3,0xb2};
unsigned char code num3[]={0xa3,0xb3};
unsigned char code num4[]={0xa3,0xb4};
unsigned char code num5[]={0xa3,0xb5};
unsigned char code num6[]={0xa3,0xb6};
unsigned char code num7[]={0xa3,0xb7};
unsigned char code num8[]={0xa3,0xb8};
unsigned char code num9[]={0xa3,0xb9};
//-------模块延时程序---------------------------- 1ms
void delay1ms(uint delay1ms) //STC11F60XE,22.1184M,延时1ms
{
uint i,j;
for(;delay1ms>0;delay1ms--)
for(i=0;i
-
:):victory:
-
回复了怎么看呀!
-
我也想看看不知道怎么回复!:carnation:
-
:):)
-
:kiss:
-
:) ha
-
楼上,程序并没有写接受的部分,只有发送!
-
:victory: