SCM control pattern lamp schematic and program

AT89C51 single-chip water light c language program

1, first in the proteus draw a simulation diagram to facilitate the simulation program

SCM control pattern lamp schematic and program

2, the following to write a program to write the first function

3, according to their own drawings in the proteus, define the pins according to your schematic

Sbit p0=P1^0;

Sbit p1=P1^1;

Sbit p2=P1^2;

Sbit p3=P1^3;

Sbit p4=P1^4;

Sbit p5=P1^5;

Sbit p6=P1^6;

Sbit p7=P1^7;

4, then write a delay function to adjust the time delay time of the water lamp to define

Void mdelay(unsigned int t)

{

Unsigned char n;

For(;t"0;t--)

For(n=0;n"125;n++)

{;}

}

5, the following is the main function, including the repeated circulation of the water lamp and the direction of the j water lamp

SCM control pattern lamp schematic and program

6, check no error, compile it. It can be simulated

SCM 32-bit LED pattern lights program and schematic
SCM control pattern lamp schematic and program

Schematic

LED heart-shaped diagram:

SCM control pattern lamp schematic and program

program:

#include"reg52.h"

#define uchar unsigned char

Uchar flag=200;

/////////////////////////////////////////////////// /////////////////////

Uchar code Tab1[]={0xFE, 0xFD, 0xFB, 0xF7, 0xEF, 0xDF, 0xBF, 0x7F, 0xFF};

Uchar code Tab2[]={0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0xFB, 0xFD, 0xFE, 0xFF};

Uchar code Tab3[]={0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x00};

Uchar code Tab4[]={0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00};

Uchar code Tab11[]={0xFE, 0xFC, 0xF8, 0xF0, 0xE0, 0xC0, 0x80, 0x00, 0xff};

Uchar code Tab22[]={0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03, 0x01, 0x00, 0xff};

/////////////////////////////////////////////////// //////////////////

Uchar code Tab33[]={0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE, 0xFF};

Uchar code Tab44[]={0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF};

Uchar code Tab55[]={0x08, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff, 0xff};

Uchar code Tab5[]={0x00, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE, 0xff};

Uchar code Tab6[]={0x00, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xff};

Uchar code Tab7[]={0x7f, 0xbf, 0xdf, 0xef, 0xf7, 0xfb, 0xfd, 0xfe};

Uchar code Tab8[]={0xfe, 0xfd, 0xfb, 0xf7, 0xef, 0xdf, 0xbf, 0x7f};

/////////////////////////////////////////////////// //////////////

Void shansuo();

Void xl();

/////////////////////////////////////////////////// /////////////

Void delay(void)

{

Unsigned char m,n;

For(m=0;m〈flag;m++)

For(n=0;n<<250;n++)

;

}

////////////////////////////////////

Void hy1(void) //lights up 90 degrees counterclockwise (one off)

{

Unsigned char i;

For(i=0;i"8;i++)

{

P0=Tab11[i]; P1=Tab22[i];

P2=Tab11[i]; P3=Tab22[i];

Delay();

}

For(i=0;i"8;i++)

{

P0=Tab44[i]; P1=Tab55[i];

P2=Tab44[i]; P3=Tab55[i];

Delay();

}

}

////////////////////////////////////////////

Void hy2(void) //Turn 360 counterclockwise in secret. (lit one by one)

{

Unsigned char i;

For(flag=250;flag”0;flag=flag-50)

{

P0=0xff; P1=0xff; P2=0xff; P3=0xff;

For(i=0;i"8;i++)

{

P0=Tab11[i];

Delay();

}

For(i=0;i"8;i++)

{

P2=Tab11[i];

Delay();

}

For(i=0;i"8;i++)

{

P3=Tab22[i];

Delay();

}

For(i=0;i"8;i++)

{

P1=Tab22[i];

Delay();

}

}

Flag=250;

}

ZGAR AZ Vape Pods 5.0

ZGAR AZ Vape Pods 5.0

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.

From production to packaging, the whole system of tracking, efficient and orderly process, achieving daily efficient output. WEIKA pays attention to the details of each process control. The first class dust-free production workshop has passed the GMP food and drug production standard certification, ensuring quality and safety. We choose the products with a traceability system, which can not only effectively track and trace all kinds of data, but also ensure good product quality.



We offer best price, high quality Pods, Pods Touch Screen, Empty Pod System, Pod Vape, Disposable Pod device, E-cigar, Vape Pods to all over the world.

Much Better Vaping Experience!




Pods, Vape Pods, Empty Pod System Vape,Disposable Pod Vape Systems

ZGAR INTERNATIONAL(HK)CO., LIMITED , https://www.szdisposable-vape.com