beating heart
The 8×8 dot matrix screen can display simple graphic symbols. Do you remember the heart-shaped pattern displayed at the back? Isn’t it satisfying to have your great stories in front of your friends? When we saw this production, we were very curious. Can we make it jump and be more dynamic?
Beating heart, very creative. If you are creative, you must take action. Rwanda Sugar Daddy repair all the way!
First design two heart-shaped patterns,
Solid “Heart” Pattern 1
Solid “Heart” Pattern 2
Rwandans Escort If the design in the program displays pattern one for 1 second, and displays pattern 2 for the next 1 second, the display will continue to cycle. Do you see a beating heart?
Circuit reference diagram
1. French desiRW Escortsgn
#include “reg5Rwanda Sugar2Rwanda Sugar.h》//Header file
#defi ne uchar unsigned char
Rwanda Sugar Daddy#dRwanda Sugarefi ne uint unsigned int
uRwanda Sugar Daddychar tabRwanda Sugarle[Rwanda Sugar Daddy]={0x01, 0x02, 0x04, 0x08, 0x10, 0x2Rwanda Sugar0, 0x40, 0x80}; //P0
//uchar table1[]={0xFF, 0x99, 0x66, 0x7E, 0x7E, 0xBD, 0xDB, 0xRwandans SugardaddyE7}; //P1 heart-shaped pattern
uchar Rwandans Sugardaddy a>table11[]={0xFF, 0x99, 0x00, 0x00, 0x00, 0x81, 0xC3, Rwandans Escort0xE7Rwandans Escort};
//uchar table2[]={0x99, 0x66, 0x7E, 0x7E, 0xBD, 0xDB, 0xE7, 0xFF}; // P1 heart-shaped pattern moves up
uchar table22[]={0x99, 0x00, 0x00, 0x00, 0x81, 0xC3, 0xE7, 0xFF};
uchar Rwandans Sugardaddyi, num; Rwandans Sugardaddy//define variables
/*delay function*/
void dRW Escorts elay(uint a)
{
whiRW Escortsle(a–);
}
/*Main function*/
void main()
{
TMOD=0X01; //0000 0001//Timer 0 task method 1
TH0=0X3C; //Load the initial value , 50ms
TL0=0XB0; //Load the initial value
EA=1; //Turn on the total stop switch
ET0=1; //Turn on the timer 0 stop switch
TR0 =1; //Start timer 0
while (1)
{
if (num》=0&&num》=2 Rwandans Escort0)
{
for(i=0;i《8;i++)
{
P0=table[i];
P1=table11[i] ;
delay(30);
}
P1=0xff;
}
if(num》20&&num》=Rwanda Sugar Daddy40)
{
for(i=0;i《8;i++)
RW Escorts{
P0=table[i];
P1=table22[i];RW Escorts
delay(30);
}
}
}
}Rwandans Sugardaddy
void timer0()interrupt 1 //Abort function
{
TH0=0X3C; //Load initial value
TL0=0XB0;Rwanda Sugar Daddy//Rwanda Sugar Load the initial value
num++; //Variable accumulation
if (num》40)
{
num=0;
}
}
RW Escorts 2. French description
if (Rwandans EscortnumRwandans Escort》=0&&num《=20)
“&&” represents logical AND, num》=0&&Rwanda Sugarnum=0 and num<=20 must be satisfied at the same time to execute the statement in "{}" .
The exciting moment Rwandans Sugardaddy is coming, download the program, and the beating heart appears in front of you. The beating heart, using table11 and table22 is a solid beating heart
發佈留言