How to record moving head movements using arrays - (Arduino Uno Programming for Beginners)

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 มิ.ย. 2024
  • How to record moving head movements using arrays - (Arduino Uno Programming for Beginners)
    In this video I show you how you can use a joystick to control a moving head that consists of two servos. I will also show you how you can record and playback movements using arrays

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

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

    you can find the ugly but working code here:
    github.com/playduino/arduino-uno-programming/tree/main/29_moving_head/moving_head

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

    Thanks 👍

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

    Wow! Beautiful 🤩

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

      Thank you 😊

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

    I must think about it a bit, but at least 2 points should be done. The 2 points that you already explained in other videos:
    a) using const variables instead of using the numbers 5, 6, ... 200.
    b) what about bouncing if you press a button? Can't that be critical if you record? So you record and because of the bouncing it might override the just done record by a very short new unwanted record?
    A third point is maybe:
    c) write a shorter main loop and call functions for 2 (sub)-tasks. A function that cares about the movement and a function that cares about the record. (maybe a bit over engineering, since you main function is (maybe) still short enough, but it is a good point to teach how to read the x and y value once and use them in the functions. You also probably want to make the project bigger and then it is fine to separate that 2 things.)

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

      thank you very much for the detailed suggestions. I will use them in the next video :)

  • @KW-ei3pi
    @KW-ei3pi หลายเดือนก่อน

    Interesting project. This "recording" concept could be a very valuable asset for many Arduino/Servo/Stepper projects. However, I just couldn't follow or understand it for two reasons. First, your videos have a "trial and error" format, which is very good for learning why code does or doesn't work. But is can be hard to follow. Second, the video covered several things and the "recording" part really needs to be a separate video. And I just couldn't understand what was being recorded. Was it the time the servo was "on"? Could this work for Stepper motors by recording the number of pulses sent to the motor? If memory is a problem, how can you get around that? Or does the insufficient amount of memory make this impractical for most projects. Thanks

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

      thank you for the feedback. I agree, it is a little bit much for one video. I'm afraid I was too enthusiastic :D
      if you have not already, please check out my second video about this project, I go through the code again and refactor it so that it looks nice, I also fixed some bugs: th-cam.com/video/ACn4-3X8LvY/w-d-xo.html
      I record the angles of the servo every 10ms in both x and y axis, I also record if the light should be on or off at any given moment of the recording.
      for example the start of xServoValues array could look like this:
      [90, 90, 90, 91, 91 , 92, 92, 93 ,94 , 95 ,96 ...]
      when I playback, I loop through this values.
      I set the servo to xServoValues[0] which is 90, after 10ms I set it to xServoValues[1] and I do this again and again until I reach the end of the array.
      yes this could also be used with stepper motors.
      you can increase the time between measurements. in theory you could even interpolate between measurements to make it smooth again but this will only work if up to a certain limit.
      the best way would be to use external memory or a microcontroller with more memory

    • @KW-ei3pi
      @KW-ei3pi หลายเดือนก่อน

      @@playduino Thanks for the reply. It helps and I appreciate it very much.
      So, my request is, please make some videos that address the things we talked about here. 😀 Also, I would like to send you pictures of my project, if you have a "junk" email address that you don't mind posting here. I'm hoping that you will be able to be successful in your TH-cam endeavors and will be able to post more projects. Thanks again. Regards

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

      feel free to send me some infos / pictures:
      youtube@playduino.com

    • @KW-ei3pi
      @KW-ei3pi หลายเดือนก่อน +1

      @@playduino Thanks. I sent an email last week. Did you receive it okay?

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

      @@KW-ei3pi Hi, yes I just answered.