analog output arduino - (Arduino Uno Programming for Beginners)

Поделиться
HTML-код
  • Опубликовано: 2 окт 2024
  • analog output arduino - (Arduino Uno Programming for Beginners)
    In this video I show how to use analogWrite. I will explain why it is not really analog but useful anyway. I will explain what pulse with modulation (PWM) is and how to generate "analog" Signals using Arduino IDE

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

  • @Volker-Dirr
    @Volker-Dirr 9 месяцев назад +2

    Nice video. Nearly perfect. I like the view from your oscilloscope and the animated graphs and also the content of course.
    Just a few minor comments:
    1. Maybe a more philosophical question: Even if analogWrite is not PWM but "real" analog output, isn't analogWrite still digital if it can write only values btween 0 and 255? If the answer is: "It is analog", then a CD is maybe in fact also analog only.
    2. Maybe record the circuit next time a bit larger, so beginners can see it better where to connect. And/or maybe add a small circuit diagram (where you can also see the UNO)
    3. Very small bug: In the forumla R=U/I , the U looks like a V.
    4. About lines like "pinMode(3,OUTPUT)": Even I like writing short code and even I done it like you in the past, I learned that in large source codes lines like that are difficult to read. Many guys add a space after a comma. So like "pinMode(3, OUTPUT)". It helps also guys that write decimal numbers like pi with a comma instead of a dot. So if they write in real life numbers like 3,14 (instead of 3.14) it is easier to read functions like function(3,14). Since you might missread it as a human as function(3.14) even it is function(3, 14).
    5. Maybe as task or next chapter: Let a LED flash and decrease the time delay. Do it until you can't see it flashing anymore and calculate the frequency. Maybe log it in the console. (I done something like that already. I was a bit suprised that I was able to see 60 Hz still flashing. I expected a lower value. I wasn't able to see it anymore at around 75 Hz flashing, even it was visible with my smartphone.

    • @playduino
      @playduino  9 месяцев назад +2

      Thank you very much for the detailed comment and the kind words!
      1. If you have a digital analog converter, one could argue it is not really analog because it still has both discrete amplitude and discrete time. At the same time, as soon as any signal (also digital signals) leaves the microcontroller is is in fact an analog signal because it is not perfect anymore. 😃 so yeah I agree
      2. good point, next time 😬
      3. in english it's supposed to be V. But it also looks wrong to me 😅
      4. I new about this convention but never new that it was to better distinguish it from floating point values. It makes totally sense, I will try to improve but this is something that always happens if I code fast 😐
      5. Indeed a very interesting experiment!

  • @joeborovina4769
    @joeborovina4769 8 месяцев назад

    Once again excellent thank you Sir

  • @Jackie-sg8es
    @Jackie-sg8es 8 месяцев назад

    Your videos are excellent in content delivery and pace. Entertaining as well. Thanks for producing these.

  • @pascalphase2556
    @pascalphase2556 8 месяцев назад

    Very instructive vidéo, but i don't understand a thing ! Why do you say that potentiometer is 0 to 1023 ? why don't we use it by 0 to 255 ? (like the arduino) sorry for my poor English, i'm French

    • @playduino
      @playduino  8 месяцев назад

      Hi there! If you haven't watched it, please have a look at video 09: ruclips.net/video/t7TW546GS3E/видео.html
      analogRead works with 10bit (0-1023) and analogWrite with 8bit (0-255)

    • @pascalphase2556
      @pascalphase2556 8 месяцев назад

      OK, now it's very clear...think you my friend !@@playduino

    • @playduino
      @playduino  8 месяцев назад

      awesome

  • @kevinlcarlson
    @kevinlcarlson 9 месяцев назад

    Would it make sense to place a capacitor across the output pins to create a smoothed DC voltage?

    • @playduino
      @playduino  9 месяцев назад +4

      Good idea, but what you need is at least a resistor + capacitor. (RC low pass filter)
      If you just connect a capacitor directly to the pin, it will be charged very fast and discharged very fast. You need a resistor to limit the current. I think I should make a video about his

    • @timberhoff
      @timberhoff 9 месяцев назад +1

      Yes!! Ill watch it!

  • @Amin-py6tl
    @Amin-py6tl 9 месяцев назад

    nice video dude understandable