Robotics Programming: Servo and HC-SR04 Ultrasonic Sensor with Arduino

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024

Комментарии • 14

  • @maryskurt
    @maryskurt 3 года назад +1

    Thank you for this!!! I like your vision for future episodes!

    • @CodingCoach
      @CodingCoach  3 года назад

      Thank you for watching and for the feedback!

  • @melvinbullock5674
    @melvinbullock5674 3 года назад +2

    Another excellent video, Thankyou!
    In your videos you show some clips with Henry ix in, he has fixed multiple sensors. Do you have any information on how you integrate these into your code please?
    I have a similar design using five sensors, but I am not a coder! Mechanic by trade, mechanic by nature ;)

    • @CodingCoach
      @CodingCoach  3 года назад

      You're welcome!
      The important thing to remember with multiple ultrasonic sensors is that they have a pretty wide (30 degrees or so) angle and you have to alternate them so they do not pick up each others pings. On a setup like Henry IX i alternate 2 banks of sensors (the left most, center, and right most being bank 1, and the two between those being bank 2). This way noise is reduced. You can trigger more than one at a time so long as their angle have enough spread.
      I relate to your last sentence, just in reverse :) I am obviously a computer scientist / software engineer by trade, but am currently starting to take the m96 engine out my old boxster to tear it apart and get my self lots of trouble (and fun hopefully) I am sure along the way. (I don't know if you are an auto mechanic, but I found that ironic either way).

    • @melvinbullock5674
      @melvinbullock5674 3 года назад

      @@CodingCoach I'm using the Arduino NewPing library to run all five sensors, they are set out at the 30,60,90,120 & 150 degree marks and the NewPing times them seperately. I can get these readings back but one or two of them will "stick" at a distance reading or 0! so trying to trouble shoot this atm!
      Refrigeration mechanic :)

    • @CodingCoach
      @CodingCoach  3 года назад

      @@melvinbullock5674 Reading of 0 means it is likely timing out or not getting a signal back. I usually set a limit check and change 0 readings into my MAX_DISTANCE.. If you put something in-front of that sensor and you are getting 0's then check the wiring and the sensor itself. If you are using the ping library then it would be calling the pulseIn() method most likely, but another thing to check would be the third parameter (the timeout length).

  • @codecage9333
    @codecage9333 3 года назад

    What happened to updating the usPm to the usCm at the end of the usReadCm function?

    • @codecage9333
      @codecage9333 3 года назад

      There I go with the "blind in one eye" thing again! I just realized we are not using usPm once we combined the motor and the sensor together. Maybe I should study what the code is doing a little longer before jumping in with questions. :-)

    • @CodingCoach
      @CodingCoach  3 года назад

      no worries! glad you found it!

    • @Shubham-po2tp
      @Shubham-po2tp 2 года назад

      @@CodingCoach
      Hello
      What is your opinion about plastic body of robot
      Can we use that robot without body
      What are disadvantages

  • @YTbxg
    @YTbxg 3 года назад

    Its very interesting though rather hard to follow without the ability to follow what you are saying by having the actual code to hand. I would like to put up you code on either another screen or a split screen to better understand the code. Github is good for code sharing.