Arduino Tutorial 23: Changing Tone of an Active Buzzer

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

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

  • @dougnash6316
    @dougnash6316 5 лет назад +33

    I just added my Patreon support for Paul. Only $5 bucks a month and worth way more than that.

  • @GDub1958
    @GDub1958 5 лет назад +31

    Paul, I can say that entering everything out each new lesson, is programming my memory more then the "mindless" act of copy & Paste, everything Paul does serves a purpose, so after a few hundred hours (6 or 7 years) of watching Mr. McWhorter teach there are actually very few actual mistakes guys and gals! BOOM
    However for me, "My Dreams Are Becoming A Reality", because I am learning "How to CODE" and remember "How to CODE"! Thanks Paul

  • @libbytardalo2071
    @libbytardalo2071 4 года назад +26

    I am loving this!
    Can't help but notice, that the watch count keeps dropping as the lessons progress.
    Buncha quitters.

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

      Maybe they're waiting for summer break or winter break

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

      ​@@rawadhasan9111 I'm in the middle of school and still watching them

  • @alicewang6342
    @alicewang6342 3 года назад +7

    Paul, you must read my mind!!! At the end of lesson 22, I was thinking to myself how to make the buzzpin to have a certain number of sounds as the LED blinked. I checked the notes that you taught us to use For Loop to set the number of blinks. Then BOOM! You taught us in lesson 23!!!

  • @vu125
    @vu125 5 лет назад +8

    I would love to like your videos more than 1M times. Thank you so much for teaching us. God Bless you. :)

  • @Eternalshammy
    @Eternalshammy 2 года назад +2

    Dear Mr. Paul,
    I am from Greece, I drink coffee when I watch your videos (with sugar though) Thank you for these videos !
    I bought the ELEGOO UNO R3 you have suggested and I wanna say that, It is exactly what I need for my projects :)
    Please keep up your good work!

  • @brentspeetzen2427
    @brentspeetzen2427 3 года назад +7

    These tutorials are extremely well done and very informative. Thank you, Paul!

  • @erichholzer9976
    @erichholzer9976 3 года назад +4

    Enjoyed this tutorial. You should note that the counter variable for the for loop can be declared and initialized in the setup of the for loop. i.e. (for int j = 0; j < someNumber; j++) {loop code}.

  • @paulusbouma9192
    @paulusbouma9192 5 лет назад +2

    I used the circuit we built in the last tutorial and imbedded the 2 for loops in the while loop used in the code associated with that circuit. The two-tone buzzer turns on and off as expected when I adjust the potentiometer. Adjusting the delay time variables also produces interesting results. Looking forward to the next tutorial! Thanks for your efforts.

  • @DaljeetSingh-yv7ch
    @DaljeetSingh-yv7ch 3 года назад

    just got back to your lessons after a few months because of school, and they are still awesome.

  • @philnewman1110
    @philnewman1110 Год назад +1

    Great video as always Paul, thank you so much!

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

    Congratulations! You the first one in a buzzer lesson who actually managed to peal off that white seal from the active buzzer. I wonder why all the others were so reluctant to do so.... :-)

  • @gweliver
    @gweliver 5 лет назад +1

    Very nice tool to have in my Arduino library! 2-tones attracts my attention more and it’s a lot more professional for projects!
    Thanks Paul

    • @paulmcwhorter
      @paulmcwhorter  5 лет назад +3

      Good deal. Worry these buzzer videos are a little boring, but need to get all the basic components out of the way first.

  • @mester.mechanic
    @mester.mechanic Год назад +1

    thanks paul

  • @aaronmilliman7685
    @aaronmilliman7685 2 года назад +1

    I acted like a little kid with the buzzer..... my wife wants to know if you teach any classes on growing up and becoming more mature.....
    Another great lesson!

  • @danbishop4035
    @danbishop4035 4 года назад +1

    Working my way through...I appreciate all of your lessons.

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

    Still here, Mr McWhorter. Ready to get back into these lessons! Thank you so much!

  • @utsavgoyal6658
    @utsavgoyal6658 Год назад +1

    Amazing as usual

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

    Still at it, and a friend of mine just got his kit and started on the lessons.

  • @lorisrobots
    @lorisrobots 2 года назад

    Still here and learning ... thx!

  • @CarolMartinYoutuable
    @CarolMartinYoutuable 2 года назад

    Thanks for another great lesson Paul

  • @JohnJones-oy3md
    @JohnJones-oy3md 4 месяца назад

    0:16 - Almost five years later and how he pronounces 'Elegoo' still makes me chuckle a bit. Can't fault him, 2019 was early days.

  • @MirceaCK
    @MirceaCK 4 года назад +1

    Hi Paul!. You can teach ´char´. "int" is not needed for such low numbers (lower memory space for char vs int). Programmers must be efficient And "j++" would be a nice trick too.

  • @maksymchumak9680
    @maksymchumak9680 2 года назад

    Paul, Thank you for making these videos!
    I'm only 11 and I know how to do an arduino!

    • @paulmcwhorter
      @paulmcwhorter  2 года назад

      Excellent! You are very far ahead of most people your age. Keep up the hard work and you will go very far in your life. Maybe you will even change the world.

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

    Thank you Mr. McWorther, this was very fun and interesting

  • @dimpledharamsi7704
    @dimpledharamsi7704 2 года назад

    hi!
    I tried with a couple of other delay times and it gave variations in the sound output. Thank you for teaching me this!

  • @matthewgroves3671
    @matthewgroves3671 Год назад +1

    my Girlfriend hates this buzzer, Time to figure out how to automate annoying her with it lol thanks again Paul, What Coffee do you like?

  • @theteenengineer7589
    @theteenengineer7589 5 лет назад

    Very nice explanation!

  • @dannycollins5698
    @dannycollins5698 Год назад

    💥
    Thank you again!

  • @Hino_55
    @Hino_55 4 года назад

    Thank you Sir Paul!

  • @tameraziz2104
    @tameraziz2104 4 года назад

    Thanks Paul.

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

    You are wonderful. My request you to make another video about millis. God bless you. Thank you.

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

    Awsome, thankyou

  • @DJL7777
    @DJL7777 Год назад +1

    Hi Paul, I have a question! Maybe I'm getting a little ahead of myself but when you use an if(....){
    digitalWrite(buzzer, HIGH);} and then writing delays and more readings to turn it off again, could you instead use an ELSE statement and in there say basically everthing under potVal 1000 digitalWrite(buzzer, LOW)?
    If been reading a little into Arduino commands and the else statement seems to be usuefull in these cases.
    Cheers and thank you very much for these wonderfull lessons!
    Davy

  • @karelenmarritkruyswijk393
    @karelenmarritkruyswijk393 5 лет назад +1

    Nice short lesson. No coffee needed ☕...

  • @erygion
    @erygion 4 года назад

    Nice quick one here but this is good thank you, I was wondering if this was possible. 😊

  • @Eternalshammy
    @Eternalshammy 2 года назад

    Thanks!

    • @paulmcwhorter
      @paulmcwhorter  2 года назад

      Thanks, that is a huge encouragement!

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

    Thank you sir

  • @opalprestonshirley1700
    @opalprestonshirley1700 5 лет назад

    It's not Classical but it works! Thanks Paul have a good one.

  • @basiceducation1131
    @basiceducation1131 Год назад

    Hi sir please tell a program for face engine sound module.with sound variation with increasing input voltage to Arduino

  • @tinnguyen1375
    @tinnguyen1375 4 года назад

    Paul and guys, I have a question: as we define output pin number, we use integer. Is it better to use constant as the pin number does not change while the program is executed? Thanks

  • @joelarthur1865
    @joelarthur1865 2 года назад +1

    int A0 = 0;
    int tmp = 0;
    int buzzPin = 11;
    int LED = 13;
    How do you fix the conflicting declaration 'int A0'

    • @michaeltanner4404
      @michaeltanner4404 2 года назад +1

      Not really sure what you are asking here, but from this little code snippet, there is no conflict. If you only put this code in your project and try to upload it, you will not get an error message (ok, you might get one that says the variables are declared but not used, but that isn't a conflict). If you can explain a bit more what you are getting, or better yet post your entire code, maybe someone can help.

  • @Dieselfitter01
    @Dieselfitter01 5 лет назад

    Paul. Your content is awesome. Are you giving up on this project? I have that exact kit and always look foreword to your next challenge.

    • @paulmcwhorter
      @paulmcwhorter  5 лет назад +3

      Do I look like the kind of guy that ever gave up on anything. Remember, I had the tutorial series "Learn Fusiohn 360 or die trying". No lots more videos in the series. I will release one from this series a week, on Tuesdays. Then on thursdays I am releasing one lesson a week on the new 9-axis project. and then will do live shop talks on Weds. when I have time.

    • @Dieselfitter01
      @Dieselfitter01 5 лет назад

      @@paulmcwhorter You are one incredible man. Thank you for everything you do for everyone.

  • @dougnash6316
    @dougnash6316 5 лет назад

    Hi Paul, I was looking forward to the next lesson. Is everything OK?

    • @paulmcwhorter
      @paulmcwhorter  5 лет назад +1

      Yes, the live stream was this morning . . . did you miss it? Make sure on your subscription to this channel that you click the bell so you will get notifications.

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

    The part when you didn't know if your code was flawless was funny 😂 (5:25).

  • @ss-fk4zj
    @ss-fk4zj 3 года назад

    Why did we use two for loops here???.... Which one did the buzzer choose??

    • @michaeltanner4404
      @michaeltanner4404 2 года назад

      It uses both of them. That is what makes the difference in the sound you hear. The buzzer stays on for longer in the second loop.

  • @alanfairclough3427
    @alanfairclough3427 2 года назад

    I am frustrated. I have got to the point where I cannot figure out how to change the com port on my serial monitor and the help thing does not show much that I can use. I am approaching the point where I pack everything up and include it in my next garage sale.

    • @paulmcwhorter
      @paulmcwhorter  2 года назад

      The computer assigns you your com port, and the arduino and serial monitor should be on the same port. You can not change it, and there is no reason to change it. It sets it, and then shows you what it is usting

    • @alanfairclough3427
      @alanfairclough3427 2 года назад +1

      Paul, thank you so much for the reply. For some reason I thought the board and serial monitor could not share the same port. I had an error message saying it could not compile for the board on com 4. I thought the com port was the problem. After much frustration I scrolled up the message to discover the real reason for the error. A period instead of a comma. You may want to mention to scroll up the error message window in case other newbies make the same mistake.
      My board is working great. I am moving right along with lesson 27. Thank you so much.

  • @dylansworld54321
    @dylansworld54321 2 года назад +1

    Can you give me the code please

  • @tinnguyen1375
    @tinnguyen1375 4 года назад

    hi Paul, I just rekcon the delaytime is actually half of the time cycle, isn't it?

  • @tinnguyen1375
    @tinnguyen1375 4 года назад

    one guy suggest us to use this function for the buzzer: tone(pinNumber,frequency,time); I tried that and reckon the sound was interrupted quite a lot while I adjusted the potentiometer, especially when I tried to SerialPrint the real-time frequency / cycle time. I guess this is because the arduino cannot handle many activities at the same time. Is that right? thanks for any explanation.

    • @BigTurtleMane
      @BigTurtleMane Год назад

      It’s been years and no one answered u 😕 Did u ever find out about this?

  • @umiturgutaswwsa
    @umiturgutaswwsa 2 года назад

    How can I change the tone of music with arduino?

  • @jritzeku
    @jritzeku 5 лет назад

    The tutorials from here are are unavailable. How do I access them? Guessing you have to pay from here on

    • @paulmcwhorter
      @paulmcwhorter  5 лет назад +4

      Do I look like the type of guy who would charge for tutorials? They are released one a week. Be patient, grasshopper

    • @jritzeku
      @jritzeku 5 лет назад

      @@paulmcwhorter hahaha that's fair! thank you sensei for your tutorials!!! Jumping on to rasberry after this

  • @Abhi-ty2ew
    @Abhi-ty2ew 3 года назад

    3:09 I literally screamed NOOOOOOOOOOO!!!!

  • @wayneandrews1738
    @wayneandrews1738 Год назад +2

    Playing music? Now that's different.
    Wayne

  • @vijaygharat2968
    @vijaygharat2968 4 года назад

    hello sir i have to buy kit but we will use all the product in it

  • @robertparker5369
    @robertparker5369 5 лет назад

    Hey Paul, it's Friday and I still can't find your Thursday Lesson.... Is everything OK?

    • @robertparker5369
      @robertparker5369 5 лет назад

      I thought you had stated earlier that you'd be releasing your Arduino Tutorials on Tuesdays and Thursdays for your followers.... Kinda looking forward to them.

    • @paulmcwhorter
      @paulmcwhorter  5 лет назад +2

      Based on feedback from participants in my live streams, a lot of people were wanting more advanced lessons. So this is what was decided. On Tuesday's I will release a lesson on the beginner tutorials as always. Then on Thursdays we will release a lesson on the 9-axis project. Then When I can on Wednesdays we will have a live shop talk session. So, three releases a week.

    • @robertparker5369
      @robertparker5369 5 лет назад

      @@paulmcwhorter- What about your students that rely on learning the basics by doing your tutorials ... we might want to learn at a quicker rate than a lesson every Tuesday when we're used to the two lesson/week (with some homework) schedule. I'm in my 60's, retired and getting bored with the 'new' slow pace.... How about reconsidering your schedule and giving your junior students a bit more than one basic lesson per week? Two per week was just great and maintained my interest. One lesson makes me want to look somewhere else for this level of training.

    • @paulmcwhorter
      @paulmcwhorter  5 лет назад +3

      You have to remember that I have to work for a living and have a full time job. Each lesson takes many hours to prepare and produce. Hence, asking that I produce more is just not practical. Also, if I only release intro classes, then those with stronger skills wander off since they already know the basics. So, keep in mind that I do have to provide for my family, and hence do have to work at a real job.

    • @chrisingram7277
      @chrisingram7277 5 лет назад

      @@robertparker5369 Hi Robert, I'm also in my 60's and have been binge watching the tutorials, I've only 4 more to go to be caught up and will have to slow down too. This is kind of a change from high school when education was more of a chore:)

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

    I don't understand where the condition that j

    • @michaeltanner4404
      @michaeltanner4404 2 года назад

      It's an arbitrary length of time that he choose. You could choose any number and change the length of each tone.

  • @dougnash6316
    @dougnash6316 5 лет назад +1

    I am a bit confused as to how dt1 and dt2 = different tones.

    • @paulmcwhorter
      @paulmcwhorter  5 лет назад +1

      It is like two different freqencies, so makes two different sounds

    • @dougnash6316
      @dougnash6316 5 лет назад

      I guess I am having issues with the C language. Are these words that are distinct in the language? I have ordered the book Let Us C and the Solutions to try and get a handle on the C language but that will be a longer journey for me.

  • @tommyh4049
    @tommyh4049 4 года назад

    Does anyone know of a way to output tone on 2 pins but have a change of tone duration or frequency if both pins are shorted together. Similar to a fluke pro 3000 with smart tone technology.

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

    Its painful to see the views slowly drop as the lessons go

  • @nishantparmar3774
    @nishantparmar3774 2 года назад

    how to possible only once time turn on buzzer after I will call then on buzzer, Please help me??

    • @michaeltanner4404
      @michaeltanner4404 2 года назад

      I'm going to need more information to answer your question. What exactly are you trying to do?

  • @Secret666
    @Secret666 5 лет назад +1

    For loops are normally written slight differently than you have shown.
    for (i =1; i < 100; i++)
    Can I ask why you tend to use j as coding convention normally uses i and why you use j=j+1 when just using ++ is easier to type and also normally coding convention?

    • @paulmcwhorter
      @paulmcwhorter  5 лет назад +5

      i looks too much like an l or a 1. Can not tell you how many hours I see people spend pulling their hair out debugging code when the mistyped i, l, or 1. I think it is good practice to use variables that easily look different. hence, j is a distinct letter, and is one often used in loops.
      as far as j++ or j+= . . . those do not make as much logical sense. When teaching and trying to explain, or even writing readable code, j=j+1 it is perfectly clear what you are doing, and it is easy to explain, and people understand it better.

    • @Secret666
      @Secret666 5 лет назад +2

      @@paulmcwhorter Thanks for the reply, yeah I see how that makes sense. This is why you are teaching and not me :) good job dude

  • @andrescaisedo2270
    @andrescaisedo2270 2 года назад

    im at 3:18 SEMICOLON!1!1

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

    Darn, everyone is knocking on my door asking me what happened.

  • @matthewcollins1858
    @matthewcollins1858 2 года назад

    present

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

    you can use "j++" instead of "j=j+1", just sayin'

  • @silverify
    @silverify 5 лет назад

    Or You can just use tone() and set frequency, done..

    • @aarickzook
      @aarickzook 4 года назад +1

      As I understand it, tone only works on an passive buzzer, not an active buzzer.

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

    I think i burned my buzzer on the last lesson.. all it does is click

  • @geonerd
    @geonerd 2 года назад

    BzzzzzzzZZZt!!

  • @theteenengineer7589
    @theteenengineer7589 5 лет назад

    Very nice explanation!