51 can the single chip microcomputer make the LED light into a breathing light, how to delay, how mu

Updated on technology 2024-04-06
14 answers
  1. Anonymous users2024-02-07

    Use a single-chip microcomputer that replaces PWM, just use a loop, while(1).

    num++;Assign this number to the PWM counter.

    delay();The length of breathing time adjusts this delay function.

  2. Anonymous users2024-02-06

    Yes, use the PWM duty cycle to do it, and the resources on 51 can do several groups.

  3. Anonymous users2024-02-05

    The cost of DA is too high. It is cheap with PWM** and has a simple circuit. The estimation frequency must be in the kilohertz, 51 may be a little more difficult.

  4. Anonymous users2024-02-04

    The brightness should also be controlled, and there should be da control.

  5. Anonymous users2024-02-03

    #define p_ioa_data (volatile unsigned int *)0x7000

    #define p_ioa_dir (volatile unsigned int *)0x7002

    #define p_ioa_attrib (volatile unsigned int *)0x7003

    unsigned int scan();Detect black line function definite declaration unsigned int num=0;

    void delay();

    void init 1() input initialization.

    void init 2() output initializes void main().

    case 2:

    case 4:

    case 5:

    case 0:}}

    p_ioa_data]=0x5f;Straight Delay(500); }

    void delay(uint z)

    unsigned int scan()

    if(line_2==0xfd)

    if(line_4==0xfb)

    if(line_5==0xf7)

    return 0;}

  6. Anonymous users2024-02-02

    org 0000h

    ljmp 0100h

    org 0100h

    main: clr ;LED1 is lit.

    lcall ys5m ;Delay 5 seconds setb; led1 off sjmp$

    ys5m: mov r7,#100 ;Delay 5 seconds.

    yll1: mov r6,#200yll2: mov r5,#123yll3:

    djnz r5,yll3djnz r6,yll2

    djnz r7,yll1ret

  7. Anonymous users2024-02-01

    Likewise, you're going to ask c.

  8. Anonymous users2024-01-31

    int main(void)

    Note that the MCU program is executed from the main function, note that the main function of the single-chip microcomputer does not add a while loop, the program will be executed all the way down until the RAM overflow produces an error, and the program will run away, so the main program must increase the loop inside, and the above format is verified by countless engineers, the writing format of the main function.

  9. Anonymous users2024-01-30

    You really should learn C a little bit, these are the more basic knowledge:

    int main, is the main function, there is a return value, the main function is the entrance of the program, void main is the same, but the return value is not required, you can also use return in the main function; Empty statements.

    Without the foundation of C language, you can't play single-chip microcomputer!!

  10. Anonymous users2024-01-29

    You should learn C first.

  11. Anonymous users2024-01-28

    1. Removing two delays at the same time will cause the level of the LED pins to continue to change between , the frequency of change is very fast, in the order of MHz, the result is that the light can not be seen directly, if the initial state of the light is off, the light will basically not see the brightness.

    2. See the previous article, no flashing.

    3. Remove the first delay, the actual lamp will continue to show the state of led=1 instruction, which is related to whether the control end of the LED lamp in the hardware is connected to the cathode or anode; Similarly, removing the second delay, the actual light will continue to exhibit the LED=1 command.

    4. The fastest flashing of the lamp that the human eye can distinguish should be about tens of Hz, and the value of the delay function can be actually changed for testing; The slowest blinking speed depends on the longest delay time of delay, where the delay parameter num is 16 bits, then when num is taken as 65535, the lamp flashes the slowest bit, in addition, you can also increase the value of the internal parameter "y=110" of the delay function to increase the delay time and reduce the blinking speed.

  12. Anonymous users2024-01-27

    If the output low level light is on, remove the first one or both and the light will not look on, and remove the second one and the light will look solid.

  13. Anonymous users2024-01-26

    The button is detected with io, and it is best to add a button to deshake, delay the timer directly, or wait with for, and the eight diodes are also directly used with the io port.

  14. Anonymous users2024-01-25

    Take turns with the value of the io port, one if to detect and one for to give the value.

Related questions
9 answers2024-04-06

This is normal, because the light on and off is driven by the low level of the single-chip microcomputer (as you can see from your program), and the high-low level load capacity given by the single-chip microcomputer is not very strong, that is to say, although it reaches the voltage, but the current is relatively small, and we write the same situation when we write programs. No problem, don't worry.

8 answers2024-04-06

1) Press F8 immediately after booting to the advanced option appears in the let go, select "The latest correct configuration" Enter to repair, and press F8 to enter the safe mode to restore the system or reinstall the system (if the reinstallation is also the case, it is recommended to overhaul it, if you can enter the safe mode, it means that you have installed something inappropriate, and uninstall all the inappropriate things before the accident, or restore the system or reinstall it). >>>More

15 answers2024-04-06

Does 50w yen spend half a year in Japan? If you don't have a good language, you can't make much money by working, and when you arrive in Japan, you will desperately pass the language, don't fight with Koreans when you study in language school, don't fool around with the little k in the past in China, you have time to work, whether you can earn money depends on whether you work hard or not, you will be very hard this year, you can't eat anything, you don't dare to buy anything, because everything is super expensive, even instant noodles are expensive, cook your own food, steamed steamed buns or something, think about sympathizing with you, come on.

7 answers2024-04-06

This will, he can deliberately break the thief, he can't do anything, they are inhumane, have no conscience, and have no morality.

7 answers2024-04-06

Summary. Hello dear, the fish tank does not put fish can also be placed at home, pay attention to the health of the fish tank but can not be empty inside, no water then the glass glue of the fish tank will soon age, put some water and then add a lid to put it up, no need to fill up, part of it can be oh pro, fish tank, a water tank for live fish, the tank body is transparent, mostly glass texture, can also be used to raise tropical fish or goldfish to play an ornamental role. The fish tank is not only a home for the fish, but also a common life for the family. >>>More