2352 views|8 replies

18

Posts

0

Resources
The OP
 

Keil Programming [Copy link]

This post was last edited by Zhao Wei 0317 on 2018-3-24 08:55 Why is this wrong? I used to be able to call delay directly, why can't I do it now? The #include at the beginning is still wrong.

捕获19PNG.PNG (29.82 KB, downloads: 0)

捕获19PNG.PNG

捕获18.PNG (36.58 KB, downloads: 0)

捕获18.PNG
This post is from 51mcu

Latest reply

Do you want to drive IO or read IO? If you want to drive, you wrote it the other way around. You need P0^0 = array[0]; otherwise P0^0 will become the input port  Details Published on 2018-3-24 10:10
 

2146

Posts

8

Resources
2
 
When declaring, do you include the declaration of the formal parameters in the brackets? For example, void delay(int i);
This post is from 51mcu
 
Personal signature坐而言不如起而行
 
 

18

Posts

0

Resources
3
 
Now I have defined the delay and there is no error in the compilation, but the static digital tube of the microcontroller has a faint light. Is it because my program is too long-winded, or is there something wrong?

捕获20.PNG (106.1 KB, downloads: 0)

捕获20.PNG

捕获21.PNG (83.42 KB, downloads: 0)

捕获21.PNG
This post is from 51mcu

Comments

Do you want to drive IO or read IO? If it is driving, it is written in reverse, P0^0 = array[0]; otherwise P0^0 becomes the input port?  Details Published on 2018-3-24 10:10
 
 
 

6

Posts

1

Resources
4
 
Change to P0^0 = array[i][0];
This post is from 51mcu
 
 
 

2146

Posts

8

Resources
5
 
Zhao Wei 0317 posted on 2018-3-24 09:28 Now I have defined the delay and there is no error in the compilation, but the static digital tube of the MCU has a faint light. Is it because my program is too long-winded, or what...
Do you want to drive IO or read IO? If you want to drive, you wrote it the other way around. You need P0^0 = array[0]; otherwise P0^0 will become the input port
This post is from 51mcu
 
Personal signature坐而言不如起而行
 
 

18

Posts

0

Resources
6
 
OK, I'll change it.
This post is from 51mcu
 
 
 

18

Posts

0

Resources
7
 
wsmysyn posted on 2018-3-24 10:10 Do you want to drive IO or read IO? If it is driving, it is written inversely, P0^0 = array[0]; This is correct, otherwise P0^0 will become...
Now the function can be realized, but I added a LED flashing program to this program, and it can run normally, but the LED flashing time interval is too long, no matter how I change it, it doesn’t work. If the front digital tube is temporarily removed, the LED flashing time returns to normal. Why? Is there any mutual influence between the delay function calls before and after?
This post is from 51mcu
 
 
 

18

Posts

0

Resources
8
 
Zhao Wei 0317 posted on 2018-3-24 13:23 Now the function can be realized, but I added a LED flashing program to this program, and it can run normally, but the time interval of the LED flashing is too...
I solved it, but there is a small problem again.
This post is from 51mcu
 
 
 

18

Posts

0

Resources
9
 
Zhao Wei 0317 posted on 2018-3-24 13:23 Now the function can be realized, but I added a LED flashing program to this program, and it can run normally, but the time interval of the LED flashing is too...
I solved it, but there is a small problem again
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