/* Name: Use the counter interrupt to achieve the button count within 100
Description: In this example, the T0 counter interrupt is used to implement the button technology. Since the initial value of the count register is 1,
Each negative transition of the P3.4 pin triggers a T0 interrupt, which increments the count value.
The clearing of the counter is controlled by external interrupt 0.
*/
#include
#define uchar unsigned char
#define uint unsigned int
//segment code
Uchar code
DSY_CODE[]={0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x00};
Uchar Count=0;
/ / Main program
Void main()
{
P0=0x00;
P2=0x00;
TMOD=0x06; //Counter T0 mode 2
TH0=TL0=256-1; //Count value is 1
ET0=1; //Allow T0 interrupt
EX0=1; //Allow INT0 interrupt
EA=1; //Allow CPU interrupt
IP=0x02; //Set priority, T0 is higher than INT0
IT0=1; //INT0 interrupt trigger mode is falling edge trigger
TR0=1; //Start T0
ZGAR bar 4000 Puffs
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 Vape, bar 4000puffs, ZGAR bar disposable, Disposable E-cigarette, OEM/ODM disposable vape pen atomizer Device E-cig
ZGAR INTERNATIONAL TRADING CO., LTD. , https://www.zgarette.com