您的位置 首页 电源

11路AD转化TLC2543CN c程序

采用1602液晶来显示转换结果,端口可以很方便的自己修改的includereg51h>includeintrinsh>includestdlibh>defineuchar

选用1602液晶来显现转化成果,端口能够很便利的自己修正的

#include #include #include  #define uchar unsigned char#define uint  unsigned int#include#define uchar unsigned char#define uint unsigned intuchar vol[3]={000},channel[11]={0x0c,0x1c,0x2c,0x3c,0x4c,0x5c,0x6c,0x7c,0x8c,0x9c,0xac};/* 端口界说*/#define LCD_data  P0             //数据口sbit inter_0=P3^2;sbit LCD_RS  =  P2^7;            //寄存器挑选输入sbit LCD_RW  =  P2^6;            //液晶读/写操控sbit LCD_EN  =  P2^5;            //液晶使能操控sbit LCD_PSB =  P2^4;            //串/并方法操控sbit eoc=P1^0;sbit clock=P1^1;sbit in=P1^2;sbit out=P1^3;sbit cs=P1^4;uint din;void delay(uint x){uint i,j;for(j=0;j>=4;num=din/4096.0*5.0;num1[0]=(uint)(num)%10+48;num1[1]=46;num1[2]=((uint)(num*10))%10+48;num1[3]=((uint)(num*100))%10+48;lcd_pos(k/3,k%3*3);delay(5);write_dat(num1[0]);delay(5);write_dat(num1[1]);delay(5);write_dat(num1[2]);delay(5);write_dat(num1[3]);delay(5);k++;}}}/*************************************/

声明:本文内容来自网络转载或用户投稿,文章版权归原作者和原出处所有。文中观点,不代表本站立场。若有侵权请联系本站删除(kf@86ic.com)https://www.86ic.net/dianyuan/255245.html

为您推荐

联系我们

联系我们

在线咨询: QQ交谈

邮箱: kf@86ic.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

返回顶部