- 1、本文档共15页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
温度数码管显示与继电器代码(Temperature digital tube display and relay code)
温度数码管显示与继电器代码(Temperature digital tube display and relay code)
/ ********************************************************************
说明:wangxun7990@126.com
********************************************************************* /
#包括 reg51. H / /库文件
#包括 absacc。”
#定义unsigned char函数/宏定义无符号字符型
# unsigned int定义单元/宏定义无符号整型
定义字节类型;
typedef unsigned int的话;
公司^ DQ=P3 0;
unsigned char minus_flag = 0;
unsigned char十,一,dot2 Dot1;
read_temperature虚空(void);
/ ********************************************************************
I/O定义
********************************************************************* /
公司领导= P0 ^ 0;/ /定义单片机P1口的第1位(即P1.0)为指示端
公司怀疑= P0 ^ 1;/ /定义单片机P2口的第1位(即P2.0)为传感器的输入端
/ ********************************************************************
延时函数
********************************************************************* /
虚空(void)极限/误差-0.234375us
{
无符号字符;
为(a=3;a>0;a);
}
delay2虚空(void)/误差-0.868055555556us
{
无符号字符a,b;
对于(b = 251;b 0;b -)
为(a=4;a>0;a);
}
#定义数据指定P2 P2 /口做为输出
公司H1 = 0 / /位选控制^数据;
数据^了H2 = 1;
公司^ H3 =数据2;
公司^ H4 =数据3;
公司大数据^ = 4;//数据输出
数据^了SC = 5;//移位时钟
公司ST = 6 / /锁存信号^数据;
/ /变量定义:
代码无符号char表[]
{ 0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90 };
/ /表:共阳数码管0-9
unsigned char l_posit = 0;//显示位置索引
输出(unsigned char dat)/移出一字节
{
未签名字符;
对于(i = 0;i 8;i +)
{
SC = 0;
DA = DAT和0x80;/ /高位先移出
SC = 1;
DAT = 1;
}
}
////////////////////////////////////////////////////
/ /温度程序
///////////////////////////////////////////////////
/ **************************************************
* file name: ds1820.c
* Description: DS1820 driver for call
* Note: this software applies to 11.0592MHz crystal oscillator
**************************************************/
/**************************************************
* function name: delay
* Description: software delay,
* input: ticks, different crystals need to be adjusted
* returns: None
* Note: this software applies to 11.0592MHz crystal oscillator
**************************************************/
Void delay (word ticks)
{for ((
您可能关注的文档
- 春夜夜从弟桃花园序,赏析(A night from the little garden of order.).doc
- 星空极速可以干什么(What can the sky speed do).doc
- 春熙路和建设路停车(Parking in Chunxi Road and Jianshe Road).doc
- 春夜宴从弟桃花园序(A feast from the little garden order).doc
- 春节祝酒辞(Spring Festival toast).doc
- 春秋和战国时期(The spring and Autumn period and the Warring States Period).doc
- 春节期间隼鹳提高排cburstoutlughingontrrytoonese盼望着做某事xpecttion名的妙招(During the Spring Festival, the Falcon stork raised the platoon cburstoutlughingontrrytoonese looking forward to doing something xpecttion's coup).doc
- 春节祝福语(Spring Festival greetings).doc
- 显卡小知识(Graphics knowledge).doc
- 显卡必读(Graphics must read).doc
- 温度计成品(Thermometer finished).doc
- 温度记录仪(Temperature recorder).doc
- 港汇广场品牌大全(Hong Kong Plaza brand).doc
- 游戏中的地图(Maps in the game).doc
- 湖北三峡人家风景区导游讲解词(Hubei Three Gorges family scenic area guide guide words).doc
- 湖北行政地区划分及车牌对应字母(Division of administrative regions and corresponding letters of license plates in Hubei).doc
- 湖北计算机一级(Hubei computer first level).doc
- 湖北(Hubei).doc
- 湿度传感器与单片机连接(The humidity sensor is connected with the singlechip).doc
- 湘渝铁路(Hunan Chongqing Railway).doc
文档评论(0)