1,下降沿触发
现象:按下k3键,Lcd值会增加。
#include <REGX52.H> #include "Delay.h" #include "LCD1602.h" unsigned char number; void main() { LCD_Init(); LCD_ShowString(1,1,"A"); IT0 = 1; //1:下降沿触发(按下触发),0:低电平触发(按着持续触发) IE0 = 0; EX0 = 1; EA = 1; PX0 = 1; //中断优先级 while(1) { LCD_ShowNum(2,1,number,3); } } void Inte0_Rountine(void) interrupt 0 { number++; }
2,定时器触发
标签:触发,普中板,void,51,number,单片机,LCD,include From: https://www.cnblogs.com/lld76/p/17350990.html