基于AT89C52写出一个跟#include <Reg52.h> sbit P1_5 = 0x95;void Time_Init() { TMOD = 0x02;TH0 = (-25);TL0 = (-25);TR0 = 1;ET0 = 1;EA = 1;} void T0_Int() interrupt 1 { static unsigned char i = 0; i++; if(i == 3) { P1_5 = !P1_5;} if(i == 10) { i = 0;P1_5 = !P1_5;} } void main() { Time_Init(); while(1); }程序功能相同的程序
时间: 2023-06-14 18:07:53 浏览: 88
基于AT89C52的实例程序及其仿真
4星 · 用户满意度95%
基于AT89C52写出一个跟#include <Reg52.h> sbit P1_5 = P1^5; void Time_Init(void) { TMOD = 0x02; TH0 = (65536-25000)/256; TL0 = (65536-25000)%256; TR0 = 1; ET0 = 1; EA = 1; } void T0_Int(void) interrupt 1 { static unsigned char i = 0; i++; if(i == 3) { P1_5 = !P1_5; } if(i == 10) { i = 0; P1_5 = !P1_5; } } void main(void) { Time_Init(); while(1); } 程序功能相同的程序
阅读全文