欢迎光临散文网 会员登陆 & 注册

pcf8591的按键代码1、光敏2,外设电压3,可调电压,用S7按钮控制

2023-07-14 22:57 作者:爱你的白嫖观众  | 我要投稿

#include "reg52.h" #include "iic.h" #define TSMG 500 #define uchar unsigned char #define uint unsigned int #define PCF8591 0x90 uchar dat=0; sbit S4=P3^3; sbit P2_0=P2^0; sbit P2_1=P2^1; uchar D[32]; double dianya; uchar code smg1[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x80,0xc0,0xc6,0x86,0x8e,0xbf,0x7f}; uchar code smg2[]={0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x78,0x00,0x10}; uint smg_vlot=0; uchar adc_value=0; float adc_vlot=0; uchar mode=1; uchar stat_smg=1; uchar control; uchar shi,ge,bai; void Hc573(uchar channel,uchar dat) { P0=dat; switch(channel) { case 0: P2=P2&0x1f|0x00; break; case 4: P2=P2&0x1f|0x80; break; case 5: P2=P2&0x1f|0xa0; break; case 6: P2=P2&0x1f|0xc0; break; case 7: P2=P2&0x1f|0xe0; break; } P2=P2&0x1f|0x00; } void delay(uint t) { while(t--); } void smgsm(uchar pos,uchar date) { Hc573(6,0x01<

pcf8591的按键代码1、光敏2,外设电压3,可调电压,用S7按钮控制的评论 (共 条)

分享到微博请遵守国家法律