源码简介: |
利用单片机P1端口控制6个交通信号灯,并使用定时/计数器T0作定时,实现交通信号灯控制。在马路的十字路过东西南北各设置红、黄、绿3种信号灯。由P1.0~P1.2控制南北方向,其中P1.0为红灯,P1.1为黄灯,P1.2为绿灯。P1.3~P1.5控制东西方向,其中P1.3为红灯,P1.4为黄灯,P1.5为绿灯。-P1 port single-chip computer control of six traffic lights, and use the timer/counter T0 to time, traffic signal control. Crossroads in the road all over East and West set the red, yellow, green three kinds of lights. Controlled by the north-south direction of P1.0 ~ P1.2, P1.0 which is red, P1.1 for the yellow light, P1.2 for the green light. P1.3 ~ P1.5 control the east-west direction, which is red, P1.3, P1.4 to yellow, P1.5 for the green light.
|