请大家多多指教
仿真原理图如下:
单片机源程序如下:
- #include<reg51.h>
- #define uchar unsigned char
- #define uint unsigned int
- sbit cs = P3^0;
- sbit rd = P3^1;
- sbit rw = P3^2;
- sbit output = P3^4;
- uchar temp;
- void delay(uint xms) {
- uint t1, t2;
- for (t1 = 0; t1 < xms; t1++)
- for (t2 = 0; t2 < 110; t2++);
- }
- void main() {
- cs = 0;
- rd = 0;
- delay(40);
- rw = 1;
- delay(70);
- rw = 0;
- P1 = 0xff;
- temp = P1;
- if (temp < 128) {
- output = 0;
- ……………………
- …………限于本文篇幅 余下代码请从51黑下载附件…………
复制代码
所有资料51hei提供下载:
基于光敏电阻的路灯控制电路.zip
(50.95 KB, 下载次数: 1086)
|