Servo motor vs normal motor - (Arduino Uno Programming for Beginners)

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 พ.ย. 2024

ความคิดเห็น •

  • @bob_mosavo
    @bob_mosavo 6 หลายเดือนก่อน +2

    @playduino Your bug is that delayMicroseconds() cannot take the large numbers you are giving it. The manual states:
    "Currently, the largest value that will produce an accurate delay is 16383; larger values can produce an extremely short delay. This could change in future Arduino releases. For delays longer than a few thousand microseconds, you should use delay() instead." For example, 19000 > 16383.
    Also, do yourself a favor and cease using "unsigned int", etc. Instead, include stdint.h and use uint32_t and its relatives. That way you will know EXACTLY how many bytes your variable is implemented with when you switch from one architecture to another or from one complier to another 😉 For instance, an "unsigned int" may be implemented by a word, which may be 16 bits on the 8-bit AVR and 32 bits on an ARM Cortex-M4.

    • @playduino
      @playduino  6 หลายเดือนก่อน +1

      wow thank you for pointing this out. I was not aware of this delayMicroseconds() limitation!
      I agree that using types like uint32_t is safer, however with beginners in mind I will keep using the simple data types.
      I try to avoid everything that would have scared me away as a beginner back in the days 😅

  • @jimg9294
    @jimg9294 6 หลายเดือนก่อน +1

    Thank you!

  • @bob_mosavo
    @bob_mosavo 6 หลายเดือนก่อน +1

    Thanks 👍

  • @310765
    @310765 6 หลายเดือนก่อน +1

    Awesome 🤩

  • @peterkarlsson7801
    @peterkarlsson7801 6 หลายเดือนก่อน

    Thanks for a good video!
    digtalWrite take some time to execute. Even if the time is very short, it can affect your "homemade" PWM signal.

    • @playduino
      @playduino  6 หลายเดือนก่อน +1

      thank you! yes this is true, digitalWrite is slow, if you need fast IO, you better directly work with the registers - however in this case the problem was delayMicroseconds(): the largest value supported is 16383 🥲

  • @Volker-Dirr
    @Volker-Dirr 6 หลายเดือนก่อน +1

    With the new UNO R4 the limit is already 8mA.

    • @playduino
      @playduino  6 หลายเดือนก่อน

      Wow, so you can‘t even drive a standard LED 😳

  • @MattC2085
    @MattC2085 6 หลายเดือนก่อน

    I’m a noob but Could it be that if you were saying less than 180 you were only making it to 179?

    • @playduino
      @playduino  6 หลายเดือนก่อน

      😂 you are correct, sorry for the confusion . The thing is, 1.5ms should be 90 degrees, but in my case it was more like 110. so the maximum input in my case would be maybe maybe 145 degrees which then results in 180 real degrees

    • @MattC2085
      @MattC2085 6 หลายเดือนก่อน +1

      Ok, now you lost me. I’ll have to let that sink in.