1839 views|5 replies

1

Posts

0

Resources
The OP
 

Question about LED flashing (newbie question) [Copy link]

I want LED lights 0 and 2 to be always on, and LED light 1 to flash. Please help me

Y6KW$C4R58P645B)SA[AF42.png (52.48 KB, downloads: 0)

Y6KW$C4R58P645B)SA[AF42.png
This post is from 51mcu

Latest reply

There is an extra ";" after your delay function.  Details Published on 2019-3-4 14:21
 

6366

Posts

4937

Resources
2
 
The most direct and simple way is to put the two statements LED0 and LED2 before the while(1) main loop. In this way, in the main loop, only LED1 will turn on and off, while LED0 and LED2 will always be on.
This post is from 51mcu
 
 
 

1368

Posts

6

Resources
3
 
Your current method can be achieved, but it is a bit slow
This post is from 51mcu
 
Personal signature专注智能产品的研究与开发,专注于电子电路的生产与制造……QQ:2912615383,电子爱好者群: void
 
 

2865

Posts

4

Resources
4
 
There is nothing wrong with this program, and it is recommended to do this. You just need to know that the program is a continuous loop!
This post is from 51mcu
 
 
 

714

Posts

2

Resources
5
 
There is nothing wrong with the logic of the program, it's just that the delay time is a bit crude. The error is because there is an extra semicolon after your delay function, just remove it.           
This post is from 51mcu
 
Personal signatureHello astroturfers
 
 

4005

Posts

0

Resources
6
 
There is an extra ";" after your delay function.
This post is from 51mcu
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list