SCM C language program design: timer control traffic indicator (1)

Single chip microcomputer STM32L151CCU6
Manufacturers produce direct sales LED lamp bead patch lighting products 0805 white light super bright indicator light dedicated
1206RGB (single)
RF cable can be customized for other specifications
0603 white 0603 white light LED lamp bead patch led led lamp beads 0603 patch

/* Name: Timer control traffic indicator

Note: After the green light is on for 5s, the yellow light flashes and the red light flashes 5 times.

After the red light is on, the north-south direction turns from a red light to a green light, and after 5 seconds, the north-south light flashes.

After 5 flashes, it lights up red, and the east and west lights are bright, so it reciprocates.

*/

#include

#define uchar unsigned char

#define uint unsigned int

Sbit RED_A=P0^0; // east-west indicator

Sbit YELLOW_A=P0^1;

Sbit GREEN_A=P0^2;

Sbit RED_B=P0^3; //North-South direction indicator

Sbit YELLOW_B=P0^4;

Sbit GREEN_B=P0^5;

//Time delay multiple, number of flashes, type of operation

variable

Uchar Time_Count=0, Flash_Count=0, Operation_Type=1;

/ / Timer 0 interrupt function

Void T0_INT() interrupt 1

{

TL0=-50000/256;

TH0=-50000%256;

Switch(Operation_Type)

{

Case 1: / thing to green light and north and south to red light 5s

RED_A=0; YELLOW_A=0; GREEN_A=1;

RED_B=1; YELLOW_B=0; GREEN_B=0;

If(++Time_Count!=100) return; //5s(100*50ms) switch

Time_Count=0;

Operation_Type=2;

Break; 单片机C语言程序设计:定时器控制交通指示灯 (1)0

[1] [2] 单片机C语言程序设计:定时器控制交通指示灯 (1)1

ZGAR AZ MC Disposable

ZGAR AZ MC Disposable


ZGAR electronic cigarette uses high-tech R&D, food grade disposable pod device and high-quality raw material. All package designs are Original IP. Our designer team is from Hong Kong. We have very high requirements for product quality, flavors taste and packaging design. The E-liquid is imported, materials are food grade, and assembly plant is medical-grade dust-free workshops.


Our products include disposable e-cigarettes, rechargeable e-cigarettes, rechargreable disposable vape pen, and various of flavors of cigarette cartridges. From 600puffs to 5000puffs, ZGAR bar Disposable offer high-tech R&D, E-cigarette improves battery capacity, We offer various of flavors and support customization. And printing designs can be customized. We have our own professional team and competitive quotations for any OEM or ODM works.


We supply OEM rechargeable disposable vape pen,OEM disposable electronic cigarette,ODM disposable vape pen,ODM disposable electronic cigarette,OEM/ODM vape pen e-cigarette,OEM/ODM atomizer device.



Disposable E-cigarette, ODM disposable electronic cigarette, vape pen atomizer , Device E-cig, OEM disposable electronic cigarette

ZGAR INTERNATIONAL TRADING CO., LTD. , https://www.zgarette.com