Oh, and I’ve watched an insane amount of Arduino tutorials all over TH-cam, read a couple books and many an article. Short of taking personal classes this is THE BEST series of tutorials I’ve found yet. The sheer detail and the LOGIC of HOW and WHY you’re coding this way is amazing. Paul - a heartfelt THANK YOU for making this content and making it available for FREE. You, sir, are awesome.
Yep. Enjoyable, compelling videos providing an excellent basis for electronics and programming. Dr. Peter Dalmaris has some very good, thorough yet almost a little too academic Arduino series on Udemy, but I look forward to watching and learning with Paul. I'm probably going to get a Raspberry Pi or Jetson Nano so I can continue learning with him. Support him on his Patreon page!
This is my favorite lesson so far. I changed the buzzing delays to microseconds to create notes and moving my hand away and towards the photo resistor changes the pitch. I'm a classical musician so I spent like 30 minutes just playing pieces, scales on the "wireless" instrument. lol
I always do your assignments alone before you do it. And I love how you explain how things actually work instead just saying "type this or that". Actually knowing how components work makes it easier for me to understand what I have to code to get desired effect. This is the best series of tutorials on Arduino on YT.
We audiences could become smarter and smarter just by listening to Paul's logic. It's so inspiring and logical. He explains everything so clearly and is beginner-friendly. Even if you're not following his experiments, you can improve your IQ by just listening to him. I mean it!
I make it before watch your solution. I used microsecond delay instead of the milliseconds, and it produced more dramatic tones. I made the room dim , turned on my iphone's flash light, and moved the flash light closer or further from the photo resister. My analog read voltage is based on the voltage of the regular resister, not the photo resister. I did brighter with lower tone and darker with higher tone first. Then did another calculation to reverse the relationship between the light and. tone: brighter with high tone and darker with low tone. It is fun! Thank you, Paul!
Most excellent teacher and series. For those wanting to know the math to Google to learn more about what Paul is using try these two in searches Point-Slope Equation of a Line The Slope Formula I have only a few OCD triggered comments delayT was defined as int but used as a float Looking up the arduino delay() function it takes an unsigned long as it's parameter that you need to pass to it so any of the integer values will work but sending in a float value would be meaningless to delay() so doing floating point math which is more costly to perform than integer math is not needed with arduino in this example. Paul is building these lessons on the fly in front of the camera so I'm not critical to Paul just passing on some things I learned after reading and researching after watching this video that inspired me. For anyone wanting to get more advanced, and I do hope Paul mentions this later in this awesome series but it is inefficient to continue to calculate again and again the same equations in a loop on a low powered microcontroller. For example m is constantly recalculated each time the loop executes. Instead define a variable m and calculate the value of m one time only above the loop() section. Then in the loop section use m which is now already pre-calculated saving compute cycles. Hence the line delayT=(9. /550.)*lightVal... Becomes delayT=m*lighVal... If you notice on the same line delayT= you have the remaining... LightVal-(9.*200./550.)+1 and this too is inefficient use of compute cycles repeating the calculation every loop--move this to another variable calculated once above the loop let's call that k for example. Now inside the loop your delayT line is now simply: delayT=m*lightVal-k; // a single multiplication and a single subtracting each loop And your microcontroller is speeding through this calculation much faster because the first and last parts have already reduced to answers needed to finish the multiplication and subtraction in this line of code. . One small catch in the pinMode() A0 the literal pin was used instead of the variable. As Paul mentioned many times earlier use the variable in case you switch physical pin used in the future. Again this is more advanced way of thinking and designing code for microcontrollers and beginners should ignore unless this makes sense to you reading this or you also get OCD over these things like me (smile). Paul if you are reading I love when you deep dive into why things work the way they do. I hope you do it more often.
Many thanks for making this series of tutorials available online! Such a valuable resource. I find it particularly interesting to hear you go into detail into the how and why. I started this series a week ago, and I certainly plan on seeing it through to the end. Cheers Paul for the quality content!
Hey Paul,i got it working slightly different but got the same end result. BOOMMM!!! Loving the videos, keep up the good work. Here's my sketch int lightVal; int toneVal; int buzzPin=8; int lightPin=A0; void setup() { pinMode(lightPin,INPUT); Serial.begin(9600); pinMode(buzzPin,OUTPUT); } void loop() { lightVal=analogRead(lightPin); toneVal=(9940./850.)*lightVal+60; Serial.println(lightVal); digitalWrite(buzzPin,HIGH); delayMicroseconds(toneVal); digitalWrite(buzzPin,LOW); delayMicroseconds(toneVal);
I worked it out for myself, based on what you had already taught me. I used an LED torch and my finger to get a range of 65 to 9500 microseconds. I simplified the equation on paper, before coding, to make the program easier to read. I checked a number of points to prove slope was valid. Neat lesson. Thank you from South Wales in the jolly old UK.
Mr. McWhorter, I've had three or four Arduino kits. I have given them all away. Due to the lack of learning I have burdened myself with. YOU my friend are by far the best teacher I've found. You have explained why the Arduino is functional. Better yet you explain the components of the kit and why they do what they do. Your attention to an all around lesson with the math and physics behind what we are doing is just what I've been looking for. I am going to keep my new Arduino, follow your lessons and actually learn. THANK YOU BROTHER!
Paul, good lesson, I was yelling at the tablet as soon as you put A0 as an OUTPUT, great to see you leave your mistakes as it is a great learning experience for everyone. The person that doesn't make a mistake does nothing.
Sir you are truly amazing. It is clear that you put all these efforts in the tutorials for us and to hear that some people dislike your videos becoz you don't spoonfeed the codes and logic is utterly disheartening. But rest assured most of us are not like that, we appreciate your hardwork and sincerity and love each second of these tutorials! You are a great teacher Paul and we love you ❤
This is a great example of the software doing exactly what you tell it! It might not be what you *expect*! A great lesson in how we can be blind to our own errors, and how we need to be methodical in working through the issue until we find the problem(s). Thank you, Paul, for not editing out this fine example!
I did the project assignment and then looked at Pauls approach. I went from a very low sound in dark to a very high sound depending on the light. And I did the math and worked with a negative slope. All in all, a very good lesson, showing how important it is to persist in finding a solution.
Paul. I have done it. I did not think I could master the Arduino, until I came across you on TH-cam. I am amazed how much you have taught me. As others have said, having watched a lot of Arduino tutorials, and have not learnt much. But yours are different I am learning lots. Thank you.
Wow, such a great tutorial. Did the math right but meshed up the variables. But making progress with understanding the formules and the math. Love the way you do the debugging! And it is so helpfull to see that anyone can make mistakes and then solve them!! You are a fantastic teacher!!!! Greetings from an old student(65 years old) from the Netherlands and many thanks for all the free lessons…..
Exactly 1 year after you posted this to TH-cam I was indeed yelling "It's the lightPin mode!" Glad you found it. Simple oversights like that can be some of the most frustrating to troubleshoot and when you find it you're like "DOH". I completed the assignment and then checked my work against yours. Pretty similar. Thanks again for these tutorials.
Hi Paul. I began to watch these tutorials a few years back when I got my first Arduino but dropped away once I began to feel self sufficient. I've watched & enjoyed many of your other series (currently watching Pico W). It occurred to me that it would be in my best interest to watch everything you've produced. I even went back & watched your original Arduino lessons. Now I'm working my way through these. You always manage to teach me something. Thank you. I will say that I had better luck with the buzzer assignment in this tutorial using the tone() statement rather than the digitalWrite() / delay() strategy. I would hope you don't have too many 'haters' these days. After all this time, people must 'get' you. Ignore them if they show up! People need to understand why things work.
I found this series and have fully gone down the rabbit hole watching. I have been looking for a great introductory series to the Arduino for my 14 year old and This is the one. Thanks for providing such a great series.
Excellent. At 14 he should be ready for this material, maybe with a little help from you. The math in these lessons should reinforce what he is learning in school, and show practical applcations of the math.
I'm a small town farmboy that likes building things. This series is exactly what I was looking for. I like that you go into the why's and how's I've made it this far planning to continue building along.
I know this series of videos has been completed quite long ago at this point, but I just want to thank you SO MUCH for explaining the math behind what you were doing. I love excercises where I have to think on how to do stuff, and the best thing is that with the method you thaught us, if I want to use another type of input or output I can make everything work because I understood the logic behind it. Thanks to your previous lessons I could do the assignment on my own withot a sweat, and it was very satisfing to see that I did everything correctly!
I was put in quarantine at home due to a family member. I ordered the kit from your link and it arrived fast. I've been following along and learned so much! It's the best boredom killer I could have asked for. Also, when this is all over I'll know how to program arduino! LOVE IT. Thank you Mr. McWhorter!
Paul, Excellent again. I keep looking at the next few lesson with great anticipation. Got lots of projects in mind and I can see as we move forward you are covering all these basics for me. Brilliant.
I made it work by myself 🙂 There are so many interesting video series about Arduino, I keep coming back to channels like this one because I actually learn new things. Paul you really explain what is going on in the circuit and components. I am happy you speed up a bit since video 20,.I really like this video series. Big thanks!
The debugging methodology is a GREAT lesson as is your more in depth theory and maths. PLEASE do keep that stuff in. By far THE best learning resource on you tube for Arduino. Keep it up ! ... and if you really want to 'shout out' to us brits ? Call it "mathS" not math ! 🇬🇧
Thanks for these videos, Paul! I found somebody else's research on NIH to find that a sample of 205 people tended to prefer a frequency centered on 399 Hz with a 350Hz bandwidth and adjusted minimum and maximum timings based off the highest and lowest frequencies, respectively. I figured a lower frequency would be more pleasant for having a brighter room, and was able to map it. :) I'm finding a lot of sense of accomplishment with each of your pop quizzes, exercises, etc, since I wasn't interested in programming until I begin looking at hardware-software interactions. Also, I am a BIG fan of how you go through device/semiconductor physics since I have taken a few courses on these courses in the past few years. Please keep 'em coming if you are still adding videos to this playlist! I look forward to the rest of this series.
Paul, you are doing an excellent job with these tutorials. Thank you for doing them. As, an old engineer myself I can point out a few things to make them better. There are always several math approaches to solving a problem. You linear math approach is one of them. But, it is very complicated and difficult to understand for most of the people watching. I would suggest instead of using linear math, i.e., xyz and slopes to solve these problems. A different approach, and simpler to understand; is to use relationship math instead. Where equations are written like for like. Example: 1/1023 = 1/255 unknowns can be substituted and easily solved for. In this case 750/10=200/1 and simple relationships can be calculated. There is not enough room here to fully explain that approach. But, you certainly are in command of that type math logic. I have found teaching relationships, even to college engineering graduate students, is much easier for them to understand. Than, what may appear to them to be abstract linear math concepts. Even though, that approach is accurate. So, is relationship math. Just a suggestion for future tutorials. Please keep up the great work.
Great Suggestion! I always had problems with Algebraic calculations, as I could not see how they linked back to the problem, as the letters did not correlate with the missing numbers. Substitution always confused me. Maths was always a challenge to me as I did not have a good foundational basis to build when starting & was very slow in picking up the principles & seeing how they actually fitted in. Just a question for anybody in this network: The subject is *MathermaticS*. Why do Americans use a singular descriptor of MATH for it?
Genuinely one of the best professors i've ever had thanks paul for all that you do. I will be taking more classes from your youtube channel in the future thank you
What I love about programming is when you build a circuit and it works perfectly (with or without debugging) you get a feeling like no other! Thanks for making this series, it is really helpful and I hope to truly understand Arduino by the end of the series.
Yes, it is like a good healthy natural high you get from undertaking a hard challenge and then succeeding. We need to get young people to find that thrill and they would no longer be chasing drugs and alcohal
I did it by myself and it was so cool afterwards. I feel like I made my own Theremin. Keep the videos coming and I will keep watching and more importantly learning.
Math it Up! I solved it using 0-1023 as my x1 and x2 values and the tone values we found in lesson 24 as my y values. Worked great. Then I re-did it doing it your way, that really helped me get a grip on the math. Love to watch peoples troubleshooting process. "Comment out" was a great bonus lesson in how to troubleshoot code. Paul you are a king among men!
Hi Paul, WoW that maths is getting complicated for me. I had trouble with my circuit to, mine was caused by my buzzer not seated properly in the bread board. I'm so glad you go through it all not only the maths but your trouble shooting as well, a lot of people would pause the video at that time. It gives me a real insight of different things to try, and the real lesson, Don't Give Up. God bless you my friend
Hey Paul, I hated linear equations at school, and dreaded doing it in the previous lesson. This time its making sense. I wish I had you as a math teacher, oh and your lessons are fantastic. I now find myself looking forward to the homework. younger me would be shocked. thank you.
Finally got it! I love the graphing. I did try to do it on my own - the math and graph but I had it wrong and had to watch the video a few more times...but I got it! My graph points were buzzerDelay, readVal: 1ms,160 and 10ms,960. This produced a low tone when resistance was low (lights on) and high tone when the lights were off. To verify my understanding, I switched slope of my line using points 1ms,960 and 10ms,160. Then I used the absolute value function on the calculated buzzer delay to get positive buzzerDelay values only. Lights on: high tone, lights off: low tone. This is so cool!!! Thanks Man!
I made my own circuit and code before I watched your video. I came out with a negative slope so that the tone was low when the lights were dim and the tone was high when the lights were bright. However you had a positive slope but we both had the same end result. X1,Y1: 0(lightVal),10,000(delaytime) X2,Y2: 1,000(lightVal), 50(delaytime) slope of those 2 points are -9000/1000 I might need to watch your answer a little closer to figure out what the difference is. However, after 26 lessons I'm still here and you got a new Patreon subscriber. Your you very easy teacher to learn from. Thank you.
I KNOW WHAT YOUR TALKING ABOUT! I I had a positive slope so my buzzer functioned the opposite of what it did in the video. Everything in the video was backward in reality than in the math I don't know how or why. Please let me know if you ever found anything out
thank you for this tutorial. I did it myself but in different way. Been studying this coding in these series. I started from scratch and it helps me a lot doing this alone.
I made it work by myself. Laid out the min and max for both toneVal (for the delayMicroseconds) and readVal, defined the pair of points and drew the line in the cartesian plane in quadrant 1 (but the line I drew was from top left to lower right, like a backslash character - high light for low toneVal (hi-pitch), low light for high toneVal (lo-pitch)), used slope formula and point-slope (learned from previous lessons), hooked up the circuits, wrote the program, worked! When light is down, pitch is low; when light is up, pitch is high (using mobile device flash light). Thank you!
I am very new to programming. I was able to get this to work on my first try but I used if statements but once you went over it, your code is much more simpler. I just want to say how grateful I am for your tutorials. Thank you so much, Mr. McWhorter.
I attempted to do it. I got most of the math and code but ended up needing a little help. I love your lessons Paul McWhorter. I learn so much and I'm working my way through them all.
Exceptional. The passion to teach and your style got me out of my couch and start working with Audrino. Working with electronics after a couple of decades now. Loving it.
Excellent tutorial, I worked out the math and code by myself first and got the circuit working before watching you do it. Really appreciate the fact you go into the physics and math behind the projects, that's how we learn not just blindly copy. Am really enjoying the "homework", hope all the upcoming lessons have this as well. Hands down the best Arduino tutorial series on the internet. Thank you.
I did it before I watch the video, however, I made a few mistakes before to get it. I am happy you challenged me before to do the project because I could learnt from my own mistakes. Thank you!!!
Thanks sir, it worked. At first, I did it in a different way without doing math using this code: int lightPin=A0; int lightVal; int buzzPin=6; int buzzVal; int dt=250; void setup() { Serial.begin(9600); pinMode(lightPin,INPUT); pinMode(buzzPin,OUTPUT); } void loop() { lightVal=analogRead(lightPin); Serial.println(lightVal); delay(dt); lightVal=map(lightVal,0,1023,0,255); analogWrite(buzzPin,lightVal); } and it was working the same way ,and also louder than the one in the video, but I don't know the reason.
haha no way, i already did this project out of curiousity after watching the last lesson. Thank you so much for your videos, you make it very easy for us to learn and then use these components on our own, and whats crazy is that theres almost no other arduino tutorial series that exist out there that could match up to this. Love from Kenya ❤
Paul you sir are a The Most WONDERFUL HUMAN BEING and the Absolute BEST TEACHER EVER!!!!!, Thank you for all your Explanations and Efforts in helping us understand and all your Jokes and Intentional Coding Mistakes. YOU ARE THE BEST!!!!!
I think one of the biggest rewards of this series is as you're giving the assignment my brain will automatically pop up what I need to do and then with your timing right afterwards you say it dand confirms for instance lightning converted into a sound immediately formula came up LOL
Making something work is genuinely one of the small pleasures in life that lead to happiness and a rich life. An LED blinking as you intended gives a high that no drug or intoxicant can. Be blessed.
I dont have a passive buzzer so instead I used the light level to fade an led by taking the lightVal and dividing by 4 then used analogWrite to write the value to an led on a pwm pin. I think I understand the lesson of using a photoresistor to control something. Which in turn helps me understand even further how to use any sensor to control another part of the circut. Man oh man am I getting some awesome ideas on some fun and useful projects!!! Thanks for all these lessons, I'm having a blast!!!!!
Hi Paul, this series is fantastic. I was able to get a working sketch/circuit on my first attempt but only because I had a good teacher. I will never forget to check for proper input/output when I'm debugging.
Greetings from yours lovely coffee origin. Really enjoying your lessons. Keep it up dear Paul. Thank you for your time. This is your fan from Ethiopia.
I, too, had an issue that needed debugging...my old eyes got my slots mixed up, and as a result, I wasn't getting a good read on my photo resistor. It's amazing what wiring it up correctly will do to make it work.... I also had to play with the values in the equations to get a better range for my setting. But...it all worked out in the end. Thanks again for the lesson. On to the next!
I tried it out on my own and thought I had created the code successfully, however after I continued to watch the video I realized I had done the math wrong, I didn't know I could have a starting point of more then 1 for the photoresistor because we never had anything similar with the potentiometers so I ended up messing up most of the math around the end when we subtracted by the slope of the line. However I have learned so much over the course of these videos and I really appreciate Mr.Mcwhorter putting out educational videos like these. I learned all these formulas but it seems I still need more practice using them with arduino! Thank you again Mr.Mcwhorter for allowing a lot of people learn the skills you have mastered (or so it seems)!
You are my Hero for Coding. I guess I am loving Coding by you. Such a great teacher. Your debugging style just different and help student. Thank you very much.
Enjoying this series from the plague-ridden future! After I got my homework assignment working I was sitting here alternating between laughing like a loon and yelling "Input! Input!" like the robot Number Five from the movie Short Circuit! Excellent work, love your all-inclusive approach.
Great and difficult session! I used different values (tone delay from 60 to 9000, and light input from 200 to 1000) then used delayMicrosecond, and the found that he serial monitor interfered with the operation of the buzzer! Thanks for the math practice!
Hello Paul, I want to thank you for the effort in these videos, this Lessons are much helpful than my actual professor from my university! Do not listen to the thumb-down guys! Your videos are the best of the best in Arduino!
Mr. McWorther! I did it, I made it work! I started at when the light is 0 the buzzer delay in microseconds is 1000 and when its 1023 the buzz is 10000, I then got a function where y = lightVal(9000./1023.) + 1000 I'm so happy that you taught me enough to let me be able to do such math for such things like arduino, here is my code. May the lord bless you int lightPin=A8; int buzzPin=4; float buzzStop; int lightVal; void setup() { // put your setup code here, to run once: pinMode(buzzPin,OUTPUT); pinMode(lightPin,INPUT); Serial.begin(9600); } void loop() { // put your main code here, to run repeatedly: lightVal=analogRead(lightPin); buzzStop=(9000./1023.)*lightVal+1000; digitalWrite(buzzPin,HIGH); delayMicroseconds(buzzStop); digitalWrite(buzzPin,LOW); delayMicroseconds(buzzStop); }
Hi Paul, I've just committed to Patreon support. The thumbs down whingers can go elsewhere. Different story if they were paying for your wonderful help.
Hello Mr Paul, great work I just made your project myself but I was stuck because I was wrong at math calculation so saw your video everything else was the same the thing is that our school is not yet at linear equations so I guess that's the flaw anyways Thanks a lot your videos are still working in 2023!
There was a mistake on the setup for the pinMode for the photoresistor, it is suppose to take the variable name not the name of the pin, I really appreciate these series, it my ticket to robotics engineering.
Paul, never feel embarrassed about making a mistake in the coding & not initially finding it. It just proves you are also human. Thanks for leaving it in & showing us the troubleshooting routine, so we too can learn from it. Much appreciated. Keep up the good work. Can you do a short series on the C++ language elements of coding, that make a big difference when left out or missplaced? Nothing more frustrating than encountering a loading error and not being sure of what the error is pointing to. Thanks very much.
I made it work. I really appreciate that you encourage us to figure out `C` on our own. I've learned so much so far. Thank you so much for these videos!!!
Hi, Paul. I just completed this lesson of the 68 and I just have to say that I love your style of teaching... and I am learning a lot and loving it! I tried to wire this one up and do the coding on my own, but ran into trouble calculating the slope for the delay values on the buzzer, so I let the video roll for you to show me how. I understand now much better how to calculate a slope, etc., and followed your example getting it to work just fine as you did. However, I wasn't happy with the sounds I was getting out of the buzzer, so I did some experimenting and found that if you use delayMicroseconds, the actual lightvalue (off the photo resister) actually corresponds nicely (it just so happens) to the Microseconds delay. I also wanted the buzzer to go higher with more light, so I would read the lightvalue and subtract it from 1023. I'm not sure if you want that much/type feedback, but here's the snippet that worked well for me to get a nice, gradual tonal response that went up as the light went up. void loop() { // put your main code here, to run repeatedly in a loop lightval=analogRead(anlpin); msdelay=1023-lightval; Serial.println(msdelay); Serial.println(lightval); for (cntr=1; cntr
I dont know why there are dislikes . it is very interesting and fun to know how and why things work as they do and be able to use that knowledge hands on to create working circuits. Love your work sir.
Paul, I was stuck trying to figure out the math. I understood the formulas but I was getting lost entering the graph points. Once I had this , the rest of the sketch was easy to create. You showing how to debug was a good point. Thanks! Manny from Puerto Rico
Hi Paul, first of all I want to thank you for these great tutorials. I recently started with Arduino, because my son will be starting with Arduino projects in his computer science class. Now we can work together on some of these projects. Incorporating math in your tutorials is a great way to make people understand how these sensors and circuits interact... For the homework assignment of tutorial 26, I did the math...A little bit later I was reading through an Arduino manual and stumbled upon the "map" function, which automatically converts lightVal to toneVal in this case. I will stay an avid supporter of doing the math, but sometimes for quick projects this function can prove usefull. I have added my code for tutorial 26 below. Keep up the good work and greetings from Belgium!!! int lightPin=A0; int buzzPin=8; int lightVal; int toneVal; void setup() {
I don't understand how anyone is giving you hate! Thanks for all of this as always. The math takes a little extra dedication but I appreciate it all... I stumbled upon the map function a bit early.
I would like to add this. I used toneVal in my equation (toneVal=(9950./750.)*lightVal+1.; ) this worked great. I got real low tones to mid to high tones. I did this one before you showed us Paul. Thank you.
Oh, and I’ve watched an insane amount of Arduino tutorials all over TH-cam, read a couple books and many an article. Short of taking personal classes this is THE BEST series of tutorials I’ve found yet. The sheer detail and the LOGIC of HOW and WHY you’re coding this way is amazing. Paul - a heartfelt THANK YOU for making this content and making it available for FREE. You, sir, are awesome.
U r absolutely correct
Of course we can always show appreciation at his Patreon page www.patreon.com/PaulMcWhorter 8=)
Yep. Enjoyable, compelling videos providing an excellent basis for electronics and programming. Dr. Peter Dalmaris has some very good, thorough yet almost a little too academic Arduino series on Udemy, but I look forward to watching and learning with Paul. I'm probably going to get a Raspberry Pi or Jetson Nano so I can continue learning with him. Support him on his Patreon page!
yep you are RIGHT!!
Completely agree!
This is my favorite lesson so far. I changed the buzzing delays to microseconds to create notes and moving my hand away and towards the photo resistor changes the pitch. I'm a classical musician so I spent like 30 minutes just playing pieces, scales on the "wireless" instrument. lol
hey same with me i also just do the same. as i am also a musician
I always do your assignments alone before you do it.
And I love how you explain how things actually work instead just saying "type this or that".
Actually knowing how components work makes it easier for me to understand what I have to code to get desired effect.
This is the best series of tutorials on Arduino on YT.
I was screaming Paul on that not being an INPUT. But i was 4 years to late haha. You've taught me so much already. Thank you!!!
Am with you currently waiting for him to figure it out 😂😂😂
I was so happy when you fixed this.......i was shouting at the screen😂🤣😁 ........im learning thank you paul your a legend
You can't imagine how much I screamed at the screen 🤣🤣🤣🤣🤣
I am still screaming because Paul used A0 in his pinMode instead of the variable name! LOL So awesome!! Thanks Paul!! :D
We audiences could become smarter and smarter just by listening to Paul's logic. It's so inspiring and logical. He explains everything so clearly and is beginner-friendly. Even if you're not following his experiments, you can improve your IQ by just listening to him. I mean it!
It is soo Canadian from you
I make it before watch your solution. I used microsecond delay instead of the milliseconds, and it produced more dramatic tones. I made the room dim , turned on my iphone's flash light, and moved the flash light closer or further from the photo resister. My analog read voltage is based on the voltage of the regular resister, not the photo resister. I did brighter with lower tone and darker with higher tone first. Then did another calculation to reverse the relationship between the light and. tone: brighter with high tone and darker with low tone. It is fun! Thank you, Paul!
I am still learning Arduino, and I am sure will learn it all, till the end of the series!
Most excellent teacher and series.
For those wanting to know the math to Google to learn more about what Paul is using try these two in searches
Point-Slope Equation of a Line
The Slope Formula
I have only a few OCD triggered comments
delayT was defined as int but used as a float
Looking up the arduino delay() function it takes an unsigned long as it's parameter that you need to pass to it so any of the integer values will work but sending in a float value would be meaningless to delay() so doing floating point math which is more costly to perform than integer math is not needed with arduino in this example. Paul is building these lessons on the fly in front of the camera so I'm not critical to Paul just passing on some things I learned after reading and researching after watching this video that inspired me.
For anyone wanting to get more advanced, and I do hope Paul mentions this later in this awesome series but it is inefficient to continue to calculate again and again the same equations in a loop on a low powered microcontroller. For example m is constantly recalculated each time the loop executes.
Instead define a variable m and calculate the value of m one time only above the loop() section. Then in the loop section use m which is now already pre-calculated saving compute cycles. Hence the line delayT=(9. /550.)*lightVal... Becomes delayT=m*lighVal...
If you notice on the same line delayT= you have the remaining... LightVal-(9.*200./550.)+1 and this too is inefficient use of compute cycles repeating the calculation every loop--move this to another variable calculated once above the loop let's call that k for example. Now inside the loop your delayT line is now simply:
delayT=m*lightVal-k; // a single multiplication and a single subtracting each loop
And your microcontroller is speeding through this calculation much faster because the first and last parts have already reduced to answers needed to finish the multiplication and subtraction in this line of code. .
One small catch in the pinMode() A0 the literal pin was used instead of the variable. As Paul mentioned many times earlier use the variable in case you switch physical pin used in the future.
Again this is more advanced way of thinking and designing code for microcontrollers and beginners should ignore unless this makes sense to you reading this or you also get OCD over these things like me (smile).
Paul if you are reading I love when you deep dive into why things work the way they do. I hope you do it more often.
Many thanks for making this series of tutorials available online! Such a valuable resource. I find it particularly interesting to hear you go into detail into the how and why. I started this series a week ago, and I certainly plan on seeing it through to the end. Cheers Paul for the quality content!
Hey Paul,i got it working slightly different but got the same end result. BOOMMM!!! Loving the videos, keep up the good work. Here's my sketch
int lightVal;
int toneVal;
int buzzPin=8;
int lightPin=A0;
void setup() {
pinMode(lightPin,INPUT);
Serial.begin(9600);
pinMode(buzzPin,OUTPUT);
}
void loop() {
lightVal=analogRead(lightPin);
toneVal=(9940./850.)*lightVal+60;
Serial.println(lightVal);
digitalWrite(buzzPin,HIGH);
delayMicroseconds(toneVal);
digitalWrite(buzzPin,LOW);
delayMicroseconds(toneVal);
And I love your "let me make myself smaller" and other layouts. Very professional.
I worked it out for myself, based on what you had already taught me. I used an LED torch and my finger to get a range of 65 to 9500 microseconds. I simplified the equation on paper, before coding, to make the program easier to read. I checked a number of points to prove slope was valid. Neat lesson. Thank you from South Wales in the jolly old UK.
I saw your A0 pin mistake from the beginning and I yelled, but you didn't listen at me.. Thank you for the lesson Paul. It means a lot for me..
Mr. McWhorter, I've had three or four Arduino kits. I have given them all away. Due to the lack of learning I have burdened myself with. YOU my friend are by far the best teacher I've found.
You have explained why the Arduino is functional. Better yet you explain the components of the kit and why they do what they do. Your attention to an all around lesson with the math and physics behind what we are doing is just what I've been looking for.
I am going to keep my new Arduino, follow your lessons and actually learn.
THANK YOU BROTHER!
Paul, good lesson, I was yelling at the tablet as soon as you put A0 as an OUTPUT, great to see you leave your mistakes as it is a great learning experience for everyone. The person that doesn't make a mistake does nothing.
Actually it should have been lightPin and not A0 so two mistakes. pinMode(lightPin, INPUT);
Sir you are truly amazing. It is clear that you put all these efforts in the tutorials for us and to hear that some people dislike your videos becoz you don't spoonfeed the codes and logic is utterly disheartening. But rest assured most of us are not like that, we appreciate your hardwork and sincerity and love each second of these tutorials!
You are a great teacher Paul and we love you ❤
So nice of you
Love that you show how trouble shooting really works. Another great video. Thanks!
This is a great example of the software doing exactly what you tell it!
It might not be what you *expect*!
A great lesson in how we can be blind to our own errors, and how we need to be methodical in working through the issue until we find the problem(s).
Thank you, Paul, for not editing out this fine example!
I did the project assignment and then looked at Pauls approach. I went from a very low sound in dark to a very high sound depending on the light. And I did the math and worked with a negative slope. All in all, a very good lesson, showing how important it is to persist in finding a solution.
I think there is no better tutorial that made by Paul. All of his tutorials are excelent.
Who in their right mind is downvoting you? Because of you, I am learning such incredible information!
Paul. I have done it. I did not think I could master the Arduino, until I came across you on TH-cam. I am amazed how much you have taught me. As others have said, having watched a lot of Arduino tutorials, and have not learnt much. But yours are different I am learning lots. Thank you.
Wow, such a great tutorial. Did the math right but meshed up the variables. But making progress with understanding the formules and the math. Love the way you do the debugging! And it is so helpfull to see that anyone can make mistakes and then solve them!! You are a fantastic teacher!!!! Greetings from an old student(65 years old) from the Netherlands and many thanks for all the free lessons…..
Exactly 1 year after you posted this to TH-cam I was indeed yelling "It's the lightPin mode!" Glad you found it. Simple oversights like that can be some of the most frustrating to troubleshoot and when you find it you're like "DOH". I completed the assignment and then checked my work against yours. Pretty similar. Thanks again for these tutorials.
I was laughing my head off, I've made that mistake more times than I can count. A fun project love these. Thanks Paul.
Hi Paul. I began to watch these tutorials a few years back when I got my first Arduino but dropped away once I began to feel self sufficient. I've watched & enjoyed many of your other series (currently watching Pico W). It occurred to me that it would be in my best interest to watch everything you've produced. I even went back & watched your original Arduino lessons. Now I'm working my way through these. You always manage to teach me something. Thank you.
I will say that I had better luck with the buzzer assignment in this tutorial using the tone() statement rather than the digitalWrite() / delay() strategy.
I would hope you don't have too many 'haters' these days. After all this time, people must 'get' you. Ignore them if they show up! People need to understand why things work.
I found this series and have fully gone down the rabbit hole watching. I have been looking for a great introductory series to the Arduino for my 14 year old and This is the one. Thanks for providing such a great series.
Excellent. At 14 he should be ready for this material, maybe with a little help from you. The math in these lessons should reinforce what he is learning in school, and show practical applcations of the math.
I'm a small town farmboy that likes building things. This series is exactly what I was looking for. I like that you go into the why's and how's I've made it this far planning to continue building along.
I know this series of videos has been completed quite long ago at this point, but I just want to thank you SO MUCH for explaining the math behind what you were doing.
I love excercises where I have to think on how to do stuff, and the best thing is that with the method you thaught us, if I want to use another type of input or output I can make everything work because I understood the logic behind it.
Thanks to your previous lessons I could do the assignment on my own withot a sweat, and it was very satisfing to see that I did everything correctly!
I was put in quarantine at home due to a family member. I ordered the kit from your link and it arrived fast. I've been following along and learned so much! It's the best boredom killer I could have asked for. Also, when this is all over I'll know how to program arduino! LOVE IT. Thank you Mr. McWhorter!
I know I am late to this party but the positive reviews you have received are exactly my sentiments. You are a teacher to the core.
I did your assignment succesfully, your videos are getting more and more educational, thank you sir
I feel so lucky to find this channel. I always wanted someone to explain how thing work rather than what to do. Thanks you alot!
Paul, Excellent again. I keep looking at the next few lesson with great anticipation. Got lots of projects in mind and I can see as we move forward you are covering all these basics for me. Brilliant.
Excellent!
I made it work by myself 🙂
There are so many interesting video series about Arduino, I keep coming back to channels like this one because I actually learn new things. Paul you really explain what is going on in the circuit and components. I am happy you speed up a bit since video 20,.I really like this video series. Big thanks!
The debugging methodology is a GREAT lesson as is your more in depth theory and maths. PLEASE do keep that stuff in. By far THE best learning resource on you tube for Arduino. Keep it up ! ... and if you really want to 'shout out' to us brits ? Call it "mathS" not math ! 🇬🇧
ABSOLUTE BEGINNER...... It took me a little bit of time; but I'm getting it..... thanks 😊
Thanks for these videos, Paul! I found somebody else's research on NIH to find that a sample of 205 people tended to prefer a frequency centered on 399 Hz with a 350Hz bandwidth and adjusted minimum and maximum timings based off the highest and lowest frequencies, respectively. I figured a lower frequency would be more pleasant for having a brighter room, and was able to map it. :) I'm finding a lot of sense of accomplishment with each of your pop quizzes, exercises, etc, since I wasn't interested in programming until I begin looking at hardware-software interactions.
Also, I am a BIG fan of how you go through device/semiconductor physics since I have taken a few courses on these courses in the past few years. Please keep 'em coming if you are still adding videos to this playlist! I look forward to the rest of this series.
I did it by my self and it worked. Math is really good and useful. It's transforming persons into engineers :)
Paul, you are doing an excellent job with these tutorials. Thank you for doing them. As, an old engineer myself I can point out a few things to make them better. There are always several math approaches to solving a problem. You linear math approach is one of them. But, it is very complicated and difficult to understand for most of the people watching. I would suggest instead of using linear math, i.e., xyz and slopes to solve these problems. A different approach, and simpler to understand; is to use relationship math instead. Where equations are written like for like. Example: 1/1023 = 1/255 unknowns can be substituted and easily solved for. In this case 750/10=200/1 and simple relationships can be calculated. There is not enough room here to fully explain that approach. But, you certainly are in command of that type math logic. I have found teaching relationships, even to college engineering graduate students, is much easier for them to understand. Than, what may appear to them to be abstract linear math concepts. Even though, that approach is accurate. So, is relationship math. Just a suggestion for future tutorials. Please keep up the great work.
Great Suggestion! I always had problems with Algebraic calculations, as I could not see how they linked back to the problem, as the letters did not correlate with the missing numbers. Substitution always confused me. Maths was always a challenge to me as I did not have a good foundational basis to build when starting & was very slow in picking up the principles & seeing how they actually fitted in. Just a question for anybody in this network:
The subject is *MathermaticS*. Why do Americans use a singular descriptor of MATH for it?
I did it by myself very fluently, you're an excellent teacher! Just flying through these
You will need to send me a gold star. But I had more of a challenge to get it working than you did. Love the tutorials. Thanks for all the effort.
Genuinely one of the best professors i've ever had thanks paul for all that you do. I will be taking more classes from your youtube channel in the future thank you
What I love about programming is when you build a circuit and it works perfectly (with or without debugging) you get a feeling like no other! Thanks for making this series, it is really helpful and I hope to truly understand Arduino by the end of the series.
Yes, it is like a good healthy natural high you get from undertaking a hard challenge and then succeeding. We need to get young people to find that thrill and they would no longer be chasing drugs and alcohal
I was doing all the homework you gave us. But, today I haven't done this assignment. I'm learning a lot, Paul and thank you for making these videos.
Excellent!
I did it by myself and it was so cool afterwards. I feel like I made my own Theremin. Keep the videos coming and I will keep watching and more importantly learning.
Math it Up! I solved it using 0-1023 as my x1 and x2 values and the tone values we found in lesson 24 as my y values. Worked great. Then I re-did it doing it your way, that really helped me get a grip on the math. Love to watch peoples troubleshooting process. "Comment out" was a great bonus lesson in how to troubleshoot code. Paul you are a king among men!
Excellent!
Hi Paul, WoW that maths is getting complicated for me. I had trouble with my circuit to, mine was caused by my buzzer not seated properly in the bread board. I'm so glad you go through it all not only the maths but your trouble shooting as well, a lot of people would pause the video at that time. It gives me a real insight of different things to try, and the real lesson, Don't Give Up. God bless you my friend
Hey Paul, I hated linear equations at school, and dreaded doing it in the previous lesson. This time its making sense. I wish I had you as a math teacher, oh and your lessons are fantastic. I now find myself looking forward to the homework. younger me would be shocked. thank you.
Finally got it! I love the graphing. I did try to do it on my own - the math and graph but I had it wrong and had to watch the video a few more times...but I got it! My graph points were buzzerDelay, readVal: 1ms,160 and 10ms,960. This produced a low tone when resistance was low (lights on) and high tone when the lights were off. To verify my understanding, I switched slope of my line using points 1ms,960 and 10ms,160. Then I used the absolute value function on the calculated buzzer delay to get positive buzzerDelay values only. Lights on: high tone, lights off: low tone. This is so cool!!! Thanks Man!
I made my own circuit and code before I watched your video. I came out with a negative slope so that the tone was low when the lights were dim and the tone was high when the lights were bright. However you had a positive slope but we both had the same end result.
X1,Y1: 0(lightVal),10,000(delaytime)
X2,Y2: 1,000(lightVal), 50(delaytime)
slope of those 2 points are -9000/1000
I might need to watch your answer a little closer to figure out what the difference is. However, after 26 lessons I'm still here and you got a new Patreon subscriber. Your you very easy teacher to learn from. Thank you.
I KNOW WHAT YOUR TALKING ABOUT! I I had a positive slope so my buzzer functioned the opposite of what it did in the video. Everything in the video was backward in reality than in the math I don't know how or why. Please let me know if you ever found anything out
thank you for this tutorial. I did it myself but in different way. Been studying this coding in these series. I started from scratch and it helps me a lot doing this alone.
I made it work by myself. Laid out the min and max for both toneVal (for the delayMicroseconds) and readVal, defined the pair of points and drew the line in the cartesian plane in quadrant 1 (but the line I drew was from top left to lower right, like a backslash character - high light for low toneVal (hi-pitch), low light for high toneVal (lo-pitch)), used slope formula and point-slope (learned from previous lessons), hooked up the circuits, wrote the program, worked! When light is down, pitch is low; when light is up, pitch is high (using mobile device flash light). Thank you!
I am very new to programming. I was able to get this to work on my first try but I used if statements but once you went over it, your code is much more simpler. I just want to say how grateful I am for your tutorials. Thank you so much, Mr. McWhorter.
I attempted to do it. I got most of the math and code but ended up needing a little help. I love your lessons Paul McWhorter. I learn so much and I'm working my way through them all.
Exceptional. The passion to teach and your style got me out of my couch and start working with Audrino. Working with electronics after a couple of decades now. Loving it.
You teach people turning light signal into voice signal! free! and excellent.... This is excellent!!
Excellent tutorial, I worked out the math and code by myself first and got the circuit working before watching you do it. Really appreciate the fact you go into the physics and math behind the projects, that's how we learn not just blindly copy. Am really enjoying the "homework", hope all the upcoming lessons have this as well. Hands down the best Arduino tutorial series on the internet. Thank you.
Fantastic!
I did it before I watch the video, however, I made a few mistakes before to get it. I am happy you challenged me before to do the project because I could learnt from my own mistakes. Thank you!!!
Thanks sir, it worked. At first, I did it in a different way without doing math using this code:
int lightPin=A0;
int lightVal;
int buzzPin=6;
int buzzVal;
int dt=250;
void setup() {
Serial.begin(9600);
pinMode(lightPin,INPUT);
pinMode(buzzPin,OUTPUT);
}
void loop() {
lightVal=analogRead(lightPin);
Serial.println(lightVal);
delay(dt);
lightVal=map(lightVal,0,1023,0,255);
analogWrite(buzzPin,lightVal);
}
and it was working the same way ,and also louder than the one in the video, but I don't know the reason.
niiiice!!
haha no way, i already did this project out of curiousity after watching the last lesson. Thank you so much for your videos, you make it very easy for us to learn and then use these components on our own, and whats crazy is that theres almost no other arduino tutorial series that exist out there that could match up to this. Love from Kenya ❤
Thanks for the kind words! I love Kenya, and especially like Kitale. I have traveled all over Kenya.
@@paulmcwhorter That is super awesome, Kitale is indeed a great place!!
I'm literally yelling at you for typing OUTPUT Instead INPUT.
I was also yelling, but retrospectively from year 2021 :) Paul is a good actor too :)
SAME but retrospectively 2 weeks after @@turatsell
@@turatsell bruh lmao .but yeah i was yelling at him in my mid
Should it not also say: pinMode (lightPin, INPUT); instead of what he wrote: pinMode (A0, INPUT); ?? It obviously worked anyway... int lightPin=A0;
Paul you sir are a The Most WONDERFUL HUMAN BEING and the Absolute BEST TEACHER EVER!!!!!, Thank you for all your Explanations and Efforts in helping us understand and all your Jokes and Intentional Coding Mistakes. YOU ARE THE BEST!!!!!
I think one of the biggest rewards of this series is as you're giving the assignment my brain will automatically pop up what I need to do and then with your timing right afterwards you say it dand confirms for instance lightning converted into a sound immediately formula came up LOL
Making something work is genuinely one of the small pleasures in life that lead to happiness and a rich life. An LED blinking as you intended gives a high that no drug or intoxicant can. Be blessed.
Loving the redo on this series. Thank you for all your hard work.
I combined the buzzer tone and LED indicators in one program Code. Super happy.
I did the same also
I love the individual projects, it allows me to do actual problem solving stuff instead of being a copy/paste robot.
I dont have a passive buzzer so instead I used the light level to fade an led by taking the lightVal and dividing by 4 then used analogWrite to write the value to an led on a pwm pin. I think I understand the lesson of using a photoresistor to control something. Which in turn helps me understand even further how to use any sensor to control another part of the circut. Man oh man am I getting some awesome ideas on some fun and useful projects!!! Thanks for all these lessons, I'm having a blast!!!!!
Hi Paul, this series is fantastic. I was able to get a working sketch/circuit on my first attempt but only because I had a good teacher. I will never forget to check for proper input/output when I'm debugging.
Greetings from yours lovely coffee origin. Really enjoying your lessons. Keep it up dear Paul. Thank you for your time. This is your fan from Ethiopia.
Actually, I live in Uganda, get my coffee from Sipi Falls on top of Mount Elgon.
I, too, had an issue that needed debugging...my old eyes got my slots mixed up, and as a result, I wasn't getting a good read on my photo resistor. It's amazing what wiring it up correctly will do to make it work....
I also had to play with the values in the equations to get a better range for my setting. But...it all worked out in the end. Thanks again for the lesson. On to the next!
I tried it out on my own and thought I had created the code successfully, however after I continued to watch the video I realized I had done the math wrong, I didn't know I could have a starting point of more then 1 for the photoresistor because we never had anything similar with the potentiometers so I ended up messing up most of the math around the end when we subtracted by the slope of the line. However I have learned so much over the course of these videos and I really appreciate Mr.Mcwhorter putting out educational videos like these. I learned all these formulas but it seems I still need more practice using them with arduino! Thank you again Mr.Mcwhorter for allowing a lot of people learn the skills you have mastered (or so it seems)!
Paul McWhorter is my favorite person that I don't personally know.
You are my Hero for Coding. I guess I am loving Coding by you. Such a great teacher. Your debugging style just different and help student. Thank you very much.
Wow, thanks!
Much like Glenn, I deserve a gold star. Also, first rule of troubleshooting:Look for the horse, not the zebra.
Enjoying this series from the plague-ridden future! After I got my homework assignment working I was sitting here alternating between laughing like a loon and yelling "Input! Input!" like the robot Number Five from the movie Short Circuit! Excellent work, love your all-inclusive approach.
Great and difficult session! I used different values (tone delay from 60 to 9000, and light input from 200 to 1000) then used delayMicrosecond, and the found that he serial monitor interfered with the operation of the buzzer! Thanks for the math practice!
Excellent!
took me a solid 45 minutes to figure out that the serial monitor was causing my buzzer to click instead of run properly.
Hello Paul, I want to thank you for the effort in these videos, this Lessons are much helpful than my actual professor from my university! Do not listen to the thumb-down guys! Your videos are the best of the best in Arduino!
Sir you are an absolute legend. Just cant tell you how badly I wanted to learn Arduino and you made it possible. Thanks for your insane efforts.
Glad I could help!
Mr. McWorther! I did it, I made it work! I started at when the light is 0 the buzzer delay in microseconds is 1000 and when its 1023 the buzz is 10000, I then got a function where y = lightVal(9000./1023.) + 1000 I'm so happy that you taught me enough to let me be able to do such math for such things like arduino, here is my code.
May the lord bless you
int lightPin=A8;
int buzzPin=4;
float buzzStop;
int lightVal;
void setup() {
// put your setup code here, to run once:
pinMode(buzzPin,OUTPUT);
pinMode(lightPin,INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
lightVal=analogRead(lightPin);
buzzStop=(9000./1023.)*lightVal+1000;
digitalWrite(buzzPin,HIGH);
delayMicroseconds(buzzStop);
digitalWrite(buzzPin,LOW);
delayMicroseconds(buzzStop);
}
Hi Paul, I've just committed to Patreon support. The thumbs down whingers can go elsewhere. Different story if they were paying for your wonderful help.
Thanks for that
Your videos are awesome Paul! Thank you for your constant positive attitude and repetitive nature! You are a great influence on everyone who tunes in.
Hello Mr Paul, great work I just made your project myself but I was stuck because I was wrong at math calculation so saw your video everything else was the same the thing is that our school is not yet at linear equations so I guess that's the flaw anyways Thanks a lot your videos are still working in 2023!
Showing the debugging process helps a lot!
great teacher, i had no problem doing this project cos i applied the knowledge from previous lessons
Great job!
There was a mistake on the setup for the pinMode for the photoresistor, it is suppose to take the variable name not the name of the pin, I really appreciate these series, it my ticket to robotics engineering.
Paul, never feel embarrassed about making a mistake in the coding & not initially finding it. It just proves you are also human. Thanks for leaving it in & showing us the troubleshooting routine, so we too can learn from it. Much appreciated. Keep up the good work. Can you do a short series on the C++ language elements of coding, that make a big difference when left out or missplaced? Nothing more frustrating than encountering a loading error and not being sure of what the error is pointing to. Thanks very much.
alhamdulillaah! It made it by myself and it worked! Thank you dear Paul! You are one of my best teachers.
Fantastic!
I made it work.
I really appreciate that you encourage us to figure out `C` on our own. I've learned so much so far. Thank you so much for these videos!!!
Hi, Paul. I just completed this lesson of the 68 and I just have to say that I love your style of teaching... and I am learning a lot and loving it! I tried to wire this one up and do the coding on my own, but ran into trouble calculating the slope for the delay values on the buzzer, so I let the video roll for you to show me how. I understand now much better how to calculate a slope, etc., and followed your example getting it to work just fine as you did. However, I wasn't happy with the sounds I was getting out of the buzzer, so I did some experimenting and found that if you use delayMicroseconds, the actual lightvalue (off the photo resister) actually corresponds nicely (it just so happens) to the Microseconds delay. I also wanted the buzzer to go higher with more light, so I would read the lightvalue and subtract it from 1023. I'm not sure if you want that much/type feedback, but here's the snippet that worked well for me to get a nice, gradual tonal response that went up as the light went up.
void loop() {
// put your main code here, to run repeatedly in a loop
lightval=analogRead(anlpin);
msdelay=1023-lightval;
Serial.println(msdelay);
Serial.println(lightval);
for (cntr=1; cntr
i love how you teach about all aspects, maths, phsyics, coding ect. amazing!!!
I dont know why there are dislikes .
it is very interesting and fun to know how and why things work as they do and be able to use that knowledge hands on to create working circuits.
Love your work sir.
Thanks Paul! Like with the other tutorials, I did the assignment alone and recorded it on my phone for reference and upload.
Dear Paul, Thank you for teaching me. I have successfully completed the assignment.
Excellent!
Paul, I was stuck trying to figure out the math. I understood the formulas but I was getting lost entering the graph points. Once I had this , the rest of the sketch was easy to create. You showing how to debug was a good point. Thanks! Manny from Puerto Rico
Hi Paul, first of all I want to thank you for these great tutorials. I recently started with Arduino, because my son will be starting with Arduino projects in his computer science class. Now we can work together on some of these projects.
Incorporating math in your tutorials is a great way to make people understand how these sensors and circuits interact...
For the homework assignment of tutorial 26, I did the math...A little bit later I was reading through an Arduino manual and stumbled upon the "map" function, which automatically converts lightVal to toneVal in this case.
I will stay an avid supporter of doing the math, but sometimes for quick projects this function can prove usefull.
I have added my code for tutorial 26 below.
Keep up the good work and greetings from Belgium!!!
int lightPin=A0;
int buzzPin=8;
int lightVal;
int toneVal;
void setup() {
pinMode(lightPin,INPUT);
pinMode(buzzPin,OUTPUT);
Serial.begin(9600);
}
void loop() {
lightVal = analogRead(lightPin);
toneVal = map(lightVal , 400 , 900 , 4000 , 1000);
digitalWrite(buzzPin,HIGH);
delayMicroseconds(toneVal);
digitalWrite(buzzPin,LOW);
delayMicroseconds(toneVal);
Serial.println(lightVal);
I don't understand how anyone is giving you hate! Thanks for all of this as always. The math takes a little extra dedication but I appreciate it all... I stumbled upon the map function a bit early.
I would like to add this. I used toneVal in my equation (toneVal=(9950./750.)*lightVal+1.; ) this worked great. I got real low tones to mid to high tones. I did this one before you showed us Paul. Thank you.
Forget about the thumbs down Sir, those are bots at best. We are absolutely LOVING this series and the fact that you challenge us with these exercises