Home > other >  Single-chip computer and how to implement the two lights on, at the same time
Single-chip computer and how to implement the two lights on, at the same time

Time:10-30

The first figure title

CodePudding user response:

CodePudding user response:

Use value is an array, use the most direct way to also go;
Example:
 
Sbit LED1=P0 ^ 1=0; . Sbit LED8=P0 ^ 7;
Then the main function
Int I=50000, d=0;
While (1) {
While (I -) d++;
If (d==1) LED0=LED8=0;
Else if (d==2)...
If (d==4) d=0; }


CodePudding user response:

Assume that IO mouth low level light LED, conversion by using a calculator to use the value of the first, I here turn in binary decimal array: {231219189126}

Using a STC89C52 MCU



CodePudding user response:

  • Related