Find 51 single chip microcomputer ultrasonic obstacle avoidance program

Updated on technology 2024-02-15
10 answers
  1. Anonymous users2024-02-06

    time=th1*256+tl1;

    This is to use the timer t1 to count, time=th1*256+tl1; This is to calculate the time according to the count value of the timer counter t1, th1 is the higher 8 bits of the counter, and the count result is of course multiplied by 256 times, plus the value of the lower 8 bits tl1.

    th1=0;

    tl1=0;

    After the calculation, rewrite 0 and prepare for the next count.

  2. Anonymous users2024-02-05

    What's going on upstairs? Have you ever studied microcontrollers? It can be achieved alone, and it can't be done together, it is a matter of adjusting the program, and the program implementation process should be seriously considered, step by step. I can't solve the problem if you don't give me the program and the specific problem.

  3. Anonymous users2024-02-04

    51 single-chip microcomputer uses machine language, it depends on the circuit design, directly facing the machine, C language program is a high-level language, not machine-oriented, can it be combined? Unless there is a special software compilation, you can use it.

  4. Anonymous users2024-02-03

    1 All I have also encountered such a problem as you, mainly because the power drive capacity is not enough, L298 to pull the voltage down, the single-chip microcomputer does not work normally, my solution is to use a 12V lithium battery, or a few more dry batteries, at least more than 10V, drive the L298 module alone, control two motors, and then make a small adapter board, use 7805 to transfer the 12V voltage to 5V, control the single-chip microcomputer circuit, the single-chip microcomputer must work normally, and the car is running that is howling.

  5. Anonymous users2024-02-02

    It should be a problem of driving ability, maybe your power supply can't move the motor.

  6. Anonymous users2024-02-01

    For obstacle avoidance, it is best to use more than two ultrasonic modules, so that there is no need for stepper motors.

    You can install two or three ultrasonic modules at a certain angle to the front of the car, so that you can judge which direction has obstacles according to the distance information of the three ultrasonic modules, so as to choose the right direction to move forward.

  7. Anonymous users2024-01-31

    Together! What's your QQ value? Add you**.

  8. Anonymous users2024-01-30

    51 single-chip microcomputer, 20 or 30pf capacitors 4, a trolley, L298N motor drive 2, 7V or 12V lithium battery, crystal oscillator 2, 40 Dupont wires, soldering iron, solder wire, ultrasonic module, LED lights, servos.

    The scheme is very simple, the above components do a good job of 51 minimum system, **buy ultrasonic module, there are 51 examples**, use it directly, so that you can get the distance between the trolley and the obstacle, and then, assemble the trolley, connect the 7V lithium battery directly to the L298N, L298 has a 5V pin interface that turns out, and use the 5V voltage it turns out to supply power to the single-chip microcomputer and ultrasonic module, and then**buy the servo for reference**, when you find that there is an obstacle ahead, decelerate, and the single-chip microcomputer controls the servo to rotate at an angle, Avoid obstacles, as for driving the trolley, use a single-chip microcomputer to generate 11kHz PWM output to L298N, and connect the trolley motor to L298, this can be seen in the L298 manual, **The merchant will give you. That's pretty much it.

  9. Anonymous users2024-01-29

    Merging the program is a technical job, and it really takes a certain amount of time and effort to do it well, and it is not very easy to express it when it is written, or it needs to be analyzed for specific problems, and the key is debugging.

  10. Anonymous users2024-01-28

    If "debug" is defined

    Send the string "test error".

    The data in the distance data shifted 8 digits to the right.

Related questions
6 answers2024-02-15

Not at all contradictory. The purpose of each port of the single-chip microcomputer is different, the structure is also different, you say that the current of the LED MA level can make it brighter, which refers to the rated brightness, different power has different brightness, you can't compare the 1 mm patch with the 10 mm one, can you understand? If you want to use LEDs at the P2 port, there are two ways. >>>More

19 answers2024-02-15

First of all, it is recommended that you use a serial port. >>>More

16 answers2024-02-15

Isn't this thing just a digital tube displaying 16 digits? Prompt you 16 times to get there, let go after you think to press the stop button. If so, the procedure is available for reference: >>>More

4 answers2024-02-15

You use a P1 port to control the dynamic scanning of 8 digital tubes, and the dynamic scanning display of digital tubes needs to be blanked. >>>More

8 answers2024-02-15

void key0()

if(p1_0!=1) *If the key 0 is pressed. >>>More