Это видео недоступно.
Сожалеем об этом.
LESSON 32: Understanding Arduino Functions
- Добавить в
- Мой плейлист
- Посмотреть позже
- Поделиться
Поделиться
HTML-код
Размер видео:
- Опубликовано: 17 авг 2024
Комментарии • 118
Следующие
Автовоспроизведение
LESSON 33: Understanding Arduino Local and Global VariablesPaul McWhorter
Просмотров 33 тыс.
7 Arduino Tips for New ProgrammersProgramming Electronics Academy
Просмотров 46 тыс.
Understanding Arduino Interrupts | Hardware, Pin Change & Timer InterruptsDroneBot Workshop
Просмотров 162 тыс.
Raygun ‘devastated’ by online hate after Olympics performanceCBC News: The National
Просмотров 1,5 млн
Injuries (ft. IceCreamSandwich)BrodyAnimates
Просмотров 818 тыс.
chronically online girl explains It Ends With Us movie drama.Nicole Rafiee
Просмотров 578 тыс.
Duke Dennis meets Gio for the first time..DukeDennis LIVE
Просмотров 647 тыс.
LESSON 35: Passing Parameters and Variables by Reference in Arduino FunctionsPaul McWhorter
Просмотров 44 тыс.
Using Arrays with For LoopsProgramming Electronics Academy
Просмотров 31 тыс.
How to win a argumentajaxkmr
Просмотров 458 тыс.
Should You Dare Criticize Kamala Harris... | Piers MorganJordan B Peterson
Просмотров 1,9 млн
These Illusions Fool Almost EveryoneVeritasium
Просмотров 2,2 млн
If __name__ == "__main__" for Python DevelopersPython Simplified
Просмотров 395 тыс.
How to do multiple tasks in Arduino | Beginners | millis() functionAmrit Aryal
Просмотров 184 тыс.
How to Use Functions in Arduino Programs - Ultimate Guide to the Arduino #18Circuit Basics
Просмотров 2,9 тыс.
LESSON 34: Return a Variable Value from a Function in ArduinoPaul McWhorter
Просмотров 40 тыс.
MELLSTROY - первое интервью: как живет самый обсуждаемый стример годаВПИСКА
Просмотров 11 млн
ЕДЕМ в ДОМЕ на КОЛЕСАХ ВЛАДИВОСТОК - МОСКВА! 10000 км с Габаром и Никитосом, Волков, ДубровскийАлексей Столяров
Просмотров 643 тыс.
Harley Quinn's revenge plan!!!#Harley Quinn #jokerHarley Quinn with the Joker
Просмотров 7 млн
Никто не может пройти эту маску #funnyTetya Mottya
Просмотров 662 тыс.
Казах без понтов - беспонтовый казах? | #Зенит #Футбол #СПБЗЕНИТ
Просмотров 618 тыс.
ЭКСПЕДИЦИЯ! | ТРАКТОР ТДТ-55 | ЧУГУННЫЕ БАТАРЕИ, ТРАКИ ПАЧКАМИ! "МАСТЕРСКИЕ ГУЛАГА" ЭТО ДАЛЬНЯЯ ЗОНАВсё из за Метало Копа
Просмотров 227 тыс.
⚡"УДАЧІ, БАТЯ!": воїни ЗСУ і місцевий мешканець у м. Суджа Курської областіYanina Sokolova
Просмотров 739 тыс.
⚡️9 ХВИЛИН ТОМУ! Оточення прийшло до путіна з ШОКУЮЧОЮ ВИМОГОЮ! Його змушують підписати…Телеканал Прямий
Просмотров 2,3 млн
Hi Paul, Just a quick help for everyone getting loop problems. Its the serial monitor option; make sure on the serial monitor window the "no line ending" option (usually along the bottom of the window) is selected. This will cure the double looping and the other errors etc. Thanks again, the best arduino/pi/hardware linux educator on the web. Wish I had you as my teacher forty years ago.
Whoaaaa.. you just saved my laptop from beeing thrown out of the window. Thnx for that cheers
Me watches video at 12 at night and about to go to sleep.
Paul : pour yourself a strong cup of coffee
Me: I dont know about that
Thanks for the great explanation. I love it when a teacher breaks hard concepts into simple pieces..
Its been a while since I did anything... but you bring it back over and over again so grateful you do these videos
Thank you for your reply Mr McWhortor! I will check out your channel. Love the lessons and even at 75, i'm learning much. Thank you!
Dear Paul, I have seen some of your Arduino videos. You have, by far, make such a wonderfull and generous work, thank you so much for sharing your knowledge. You upgrade my understanding and light up my mind. Greetings from Colombia (SouthAmerica)
When I see you have a new video everything else has to wait until I watch it!
Great!
It started with a curiosity about this thing called Arduino. Your lessons, (particularly your teaching style) were perfectly matched to the way I learn. I watched all of your lessons before I even bought an arduino. When I bought one, I went through every lesson again. I had just finished the last lesson and was beginning to search for more arduino content when my subscription notified me of this new lesson. Bottom line - you made my day! Thank you for continuing this series. (P.S. I'm proud to say I think I would earn high grades in any class taught by you).
Very good. Consider yourself a student with A+ in my class. Good job.
exactly what I was thinking - particularly the teaching style - raw without polish (exactly the way it is in real life!).... and the, now very famous phrase, "if you're like me" is very appealing ....
I really don't like such less number of likes, Sir, you deserve more!
I appreciate that!
By the way thanks to your videos I was able to desing in Fusion 360 for the company I work for, and now proudly figure on 2 world wide patents that the company sold.
Big thanks you!
Remember your old friend when your patents hit is big! Just kidding, glad to hear the lessons were useful.
Haha yes! Upside they keept my name as "inventor" downside I dont get to see a cent! But, you know, its a start, at least I got to proove my self and hopefully some day it will pay back. Thanks again Paul
Charles Sabate hello, could you please link to your patent description. We could all learn from the application. Thank you.
It's 2022 and you still rock. Thanks a lot Paul :)
Nice work once again.
Love to see you tackle programming Arduino to use shift registers in different applications.
i love this man, i will protect him at all cost
Love the more advanced lessons. Paul, You Da Man
Great video Mr. Mcwhorter, easy to understand. I'm glad you're still making videos 🌞 I'll keep watching.
Love these videos Paul! Keep them coming :)
a New lesson from Paul. Wonderful! I'm so excited!
OK, glad you found the new lesson. Hope to do some more pretty soon
Thank you for helping our learners. We really really appreacite your efforts.
Just my two cents: STM32 is a very hot topic these days, so it would be great if we could receive some lessons on that from you. That would be awesome!
Have a good night.
Thanks a lot this really made me program more elegantly and more consistent and easier to understand. You really helped me a lot. Thank YOU!!!!!!!!!!!!!!!!!!!! You are the BEST!!!!!!!!!!!
Simplest video on functions thank you. You make it a lot easier to learn.
Great to hear!
You are soo good. I like your tutorials.
Very nice explanation of how to use functions to make program easier to follow. I have a question about your example:
What is the purpose of declaring "float grades[15]" ? I did not see where the variable grades was used.
Thanks.
Very happy to see more Arduino lessons.
I love your videos. They were and are really helpful to me and my study projects, private programming and beyond :) Thanks a lot!
Thank you soo much for all the content and clear posting of how to do stuff.
Hi, Mr. McWhorter! I’m a relatively new subscriber. I like your videos and I’ve learned a lot from you. Thanks!
Please keep 'em coming. I've tried other tutorials but they all seem to expect you to know some other coding language already. I like that you start at square one.
Also, I agree with Daniel Turner
. More Learn Fusion 360 or Die lessons.
I poured myself a pint of lager instead of coffee. Can i say. I favorited your channel a while back. I am subscribed. I have a few various arduino's now and a couple of kits. It's something i really want to learn. But never seem to have the time. But your lessons are really good. Thank you. When ever i pick them back up, i always return to your channel.
Drinking and coding . . . a dangerous combination. Just kidding, but I do really love a good strong cup of coffee.
Paul McWhorter
I always practice safe coding , if i have a beer i turn the IDE off and sit back and enjoy watching and learning from you instead !
Yup... me too... gave up beer entirely...
@ ian ...ahh... now that's advice I was waiting for ! thanks...
Finally! Very clear explanation. Thanks a lot.
Thanks!
Thanks! easier to understand when taught as computational thinking with code
I think that in your example the first candidate for a function is the reading of an integer and a float from the serial port. It's the piece of your code that has the greater probability to be reusable. So, we can also have the following two functions:
int getIntFromSerial()
{
int num;
while (Serial.available() == 0) {
;
}
num = Serial.parseInt();
return num;
}
float getFloatFromSerial()
{
float num;
while (Serial.available() == 0) {
;
}
num = Serial.parseFloat();
return num;
}
Keep up your great work.
But I haven't explained the return command. I will do that in an upcoming video. I want to show how to return a variable, and also then I will show how to pass parameters inside the parenthesis
I'm sorry for my impatience. I didn't realise that this is the first of a video series about functions, so I decided to give a little bit of extra information. Keep up the good work.
Hey Paul! I completed your Fusion 360 tutorial series, which I thought was very useful! I would love to see more as there is a lot of functionality you didn't cover.
As for this Arduino tutorial series, I've had one lying around for a year so I might finally learn to use it thanks to you!
I also have a few suggestions for your video editing, if you'd be interested?
I would be interested in your comments on video/studio. I have a really nice camera, and green screen, but struggle terribly to get good audio. I have bought several microphones, but never get good audio. Also, I just shoot the whole thing, and then upload it warts and all. I barely have time to make the videos and upload them, so dont have the energy to go in and edit and polish them. I do think I am doing better than a few years ago when it was just a webcam and screen capture software.
personally, I love the raw versions (all of them!), they always show of the reality of the whole process of struggling with the Arduino...
I've had similar issues with audio, and spent ages trying to fix them!
I understand that producing videos can be pretty time consuming, but it'll likely be the solution to many potential problems. Since your videos are all quite similar in format, you could do it once and make a template which would allow you to sort out the videos in no time at all! I'd certainly give it a try at least once.
My top tips would be as follows:
AUDIO
1. Record the audio separately, perhaps using a program like Audacity or plugging it into your mobile. You can then sync it up using a clap.
2. Have a period where you're not talking so Audacity can sample the noise and subtract it from the recording. This will remove any hiss and make the audio a bit softer.
3. Always use the same settings for the mic and programs, and try to always be in the same place relative to the microphone. Consistency will help you zero in on perfect audio. If you find this difficult, a headset or lapel mic could work better as they move with you and since they're closer you can turn the gain down, which will reduce background noise.
4. Use an external DAC if recording from your computer - i.e. a male USB to female mic and headphone jacks. These can be bought for under $2 including shipping from eBay. They can drastically increase the signal to noise ratio on the microphone, giving you better dynamic range and reducing how much noise reduction you'll need to do, which will lead to the best possible sound. I use one myself as I was getting hissing sounds off the one on my motherboard in my computer.
VIDEO
1. Your camera looks lovely and sharp, sharper than before, but I think it might be a little bit overexposed. Try turning down the sensitivity and your lovely orange shirt will shine bright! It's also a good idea to do this on a screen with good colour accuracy, so if you can use an IPS (most common), QLED or OLED display rather than a TN panel to edit on, you'll be able to nail it. Once you have, write down or save all the settings you used!
2. Try recording your screen and yourself separately. I remember you mentioning that you had to re-record lessons as you forgot to put yourself back to the corner. I'm not sure what software you're using, but it looks similar to those used for live streams. Although a live stream from you would be great fun (we could all talk to you in the chat as you go), you shouldn't use that kind of software unless you need to as it can cause these sorts of problems that would otherwise not happen. Using regular editing software like Premiere Pro or Davinci Resolve (free) would be much easier. That way you can totally hide yourself if you need to show something in the bottom-right.
3. Your videos are 16:9 aspect ratio, but your screen is 16:10. This results in the black 'pillarboxing' you see either side of your screen. Since 16:9 is the most common aspect ratio for RUclips (most TVs and monitors today too), I would suggest changing your screen resolution to one with a 16:9 aspect ratio when recording videos. If you want to just show one program, you could set a custom resolution such that its maximised window would be 16:9 - you can calculate this knowing the taskbar is 40 pixels tall and the title bar of windows are 29 pixels high. The 3 other borders on windows are 3 pixels wide. Always go for the highest resolution possible, but for your screen to keep things big enough to see I'd max out at 1920x1080 so most people will be able to see the smallest text.
4. Try recording (on PC and camera), rendering and uploading at 60 frames per second. This is personal preference, but you might like it too! Your current frame rate is 24, which is good, but a bit more motion can improve the fidelity of the video, and can be useful when showing moving scenes - e.g. rotating the camera in Fusion 360. Note that this could reduce exposure on the physical camera, depending on your current shutter speed. For an example of what this might look like, take a look at recent videos on the RUclips channels GamersNexus or Thomas Sanladerer.
5. Try exporting and uploading at a higher resolution. RUclips are notorious for reducing the visual quality, so to get around that many youtube channels record in (for example) 1080p, then render and upload in 4K. This will increase the sharpness of your videos further.
Lastly, make sure you sit up straight so you can speak clearly and keep yourself in the same spot relative to the mic, and most importantly: smile! Heck knows we're all smiling back!
Please take all of this with a grain of salt of course - I'm a science student in the UK who grew up in a family running an IT company, so I sort of know my stuff but most of it is self-taught.
If you have any questions about any of this I'd be happy to go into more detail for you, considering you've helped me out so much it's the least I can do!
Absolutely excellent explanations Paul, Many thanks!!
Thanks Paul, a good explanation, i'm learning step by step....
Thank you, may the Lord bless you for your helping me.
Glad to help
very good Paul!
Hi Paul ,
I have been watching a lot of tutorials and youtube videos on various Arduino projects ( and fusion 360 ) and can honestly say none of them - not one even came close to the quality of your videos ! For some reason other makers seem to show the IDE as a little square on the screen that is impossible to see , it is almost as if they are trying to hide something from you - possibly bad coding ! Or they use the yellow halo to highlight the mouse pointer and are intent on zooming around all over the place so you can't read the sketch ! Just when you focus on it they scroll down the page to talk about some other irrelevant part of the sketch and move on !
Thanks for the video and i await the next instalment !
Thank you! I wish I had such teaching skills like yours!
Very clear Paul, thanks
Thanks. interested in Millis(); timing with dimensional array for loop (no delay function, only use Millis(); Great teacher
Really useful, clear and very well preeented, thank you!
please upload videos regularly!!! we can't wait months to watch your videos! plzzzzzzzzzzzzzz its a request
Some of the text appears fuzzy and is difficult to read.The "square" brackets look like normat "curved" brackets. Please mention each time when a "square" bracket is used. Thanks for an imformative video
10 I had a year in BASIC back in 1988.
20 Never used it.
30 Now Im a newbie with arduino.
40 C is doable, like BASIC but not easy.
50 I will come back to these in depth vids after I finish the arduino course.
60 END
Please teach spi and i2c communication with arduino and raspberry pi....
Hello, I am creating a door lock using IR, with a push button and RFID. I'm naming each of the three parts after void loop IR sketch, button sketch and RFID sketch. Then I name each part putting void in front. Why does it say 'IR sketch was not declared' if when I scroll down to the start of the IR sketch I named it void IR sketch(); ?
For some reason when I declare a function after my void loop it says that the variable has not been defined, but when I put it before my loop it works fine. Is it supposed to like this
Is the Arduino limited as to the amount of code? As a programmer I know that the entire process could be done in one FOR loop, giving the exact same results and saving run time by reducing the number of loops.
Hi Paul, I"m having an issue... the program is processing the grades before I input all grades. It's automatically entering zero for the grades I don't have a chance to input, so it's throwing out my average.
int numGrades;
float grades[15];
int j;
float av;
float bucket=0;
void setup() {
Serial.begin(9600);
}
void loop() {
inputGrades();
avGrades();
printGrades();
}
void inputGrades(){
Serial.println("How Many Grades? ");
while (Serial.available()==0){
}
numGrades=Serial.parseInt();
for (j=1;j
your tutorials are great ,can you please do a tutorial also on i2c and spi interface
On my DHT sensor meter that I built. I am using three LED's, Green for cool, yellow for normal temp and Red for warm and I turn all three on if the temp is above 88F. I run this test in the void set up. When I write the function and define it below the void loop, it says the function isn't defined. So, I was wondering if we can run functions in the void setup. (I run the test there because I don't want it to run all the time.
I found little bug in your code. When you use inputGrades(), if you use this function and in for loop is j=1 => this means that the first place in array[0], will be always empty. But really nice tutorial on functions. Thank you :)
I have to say it... ";" is a SEMIcolon!!!
hi sir.....if and else if are not working inside in new void
Mister Paul thank you for your wonderful Arduino lessons I've just start learn it and your videos have helped a lot. There is one thing that I still don't know is a code for a project that I have in hands: a relay activating after an IR beam been interrupted for 3 times. Could you please help me with that or post a video? thank you.
Vitor
hey Mr Paul my name is mahdi from morocco
I just want to thank you for all your lessons is very usefull.
***
I have a question please: Can you guide me to find a simple course in Real time Operating system (RTOS).
You have got yourselve a new sub. Very good tutorial thank you.
Question: can i store the user input (say 3 values) combined as 1 value in a variable? Like input = 1 and 2 and 3. Can i store the inputvalue as 123 from the loop in a variable? If yes? How? I am knobling about it for hours. Serial.print(grades[j]); does the trick of showing the 123 in serial, but i dont know how to store it. Thank you sir
hi the videos are wonderful and excelent but when i done coading i am getting an id returned 1 or 2 error what is that please explain sir mr any one
What is wrong with my code, I do not find any syntax mistake in code. Then the code runs I get request to enter number of grades. I enter, lets say, number 5. And after that I get two lines of requesting to enter grade. I enter number 2 and 3 and right after that I get all stats on Serial monitor with three 0 values and average of 0,60. I noticed that I get double entries, one I enter and second value with "0". What makes it happen?
I've just put "j" in "for" loop to Serial.print each time I'm asked to enter grade. So what do you think what I found? Loop "for" spins two times before it stops and waits till I enter grade. When I enter it, loops spins another two times and stops. So if I set numGrades to 3, I can enter only one value. Two others are 0. The same is when I enter bigger numGrade value - it waits for input after he runs one loop by it self.
I'm totally lost on this...
+1 same thing happens to me. Frustrating level 10, but also good to drill down the code. Still no luck btw..
Don't you need to make forward declarations in arduino?
Can we use functions in the void setup?
Ow! I get you might not want to edit, but I'm listening on earbuds. That sneeze hurt!
Wright Brothers 1903 to a Man on the Moon 1969 in 66 Years.. ENIAC COMPUTER 1945 to the Arduino board was introduced in 2005 about 60 years... there go the lab-coats. 😊
Nice video..Do more video
Thanks a lot.
Thanks
Ahh thats how to do sub routines in arduino
Sorry but, I found that if I put the function in the void loop, it runs fine except for, it does the led test each time it goes through the loop. So evidently it won't work in the void set up. Since I only run this code once. I'll just leave the code in the void set up! That works fine and isn't really a problem. I think I have learned something. I got the function right but, the application wrong!
Hi sir could you please teach on using atmega 328 on pure c coding rather than using the arduino ide ....or some tutorials on pic microcontrollers...
Good stuff
WHat about doing all that stuff on a ESP8266 ?
Good day sir Paul, can u give me sample on how to delete specific line from a text using using arduino and sdcard,
📺
I just wish there was less focus on what the program does, which is very simple, and more focus on the code structure used to make it happen. I find myself trying to block out the examples while I try to dissect and understand the structure of the code. The examples are just a distraction.
thanks for the video, but when I write your code, I get an error and that error is for loop run for two times after entering grades. First, it takes automatically zero value and the second one from serial monitor, then the third one is automatically zero and so on.
int numGrades;
int j=0;
float grades[15];
float bucket;
float av;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
numGrades =5;
for (j=0; j
Make sure on the serial monitor window the "no line ending" option is selected at the bottom of the window. This will cure the double looping and the errors etc
@@mrdhughes4635 Hi there, I was also running into that issue until I read your comment and it fixed it, like magic. Would you kindly explain to me what the No line ending vs New line means? Thanks :)
great... tanxs tanxs..
Paul, I am new to Arduino but, I do have some questions. I see that these comments are a year or so old. Are you still doing videos yet in 2019?
Yes, check out the channel. I release three videos a week.
I followed along lesson 32 (Your lessons are awesome by the way) and I have a glitch that keeps happening and I can't seem to find it. The glitch is that It asks twice "Please Input a Grade" every time I click send resulting in 0.00 entered on odd numbered entries. Please help. Here's my code below:
int numGrades;
float grades[15];
int j;
float av;
float bucket = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
inputGrades();
avGrades();
printGrades();
}
void inputGrades() {
Serial.println("How Many Grades? ");
while (Serial.available() == 0) {
}
numGrades = Serial.parseInt();
for (j = 1; j
Can you do a tutorial about nrf24lo1?
"VEML6040 RGB Sensor" actually VEML6040-SB made by "VISHAY" your "Virtuobotix Color Sensor" has been discontinued! i think this is a better one anyway but how do i use it? can i just replace it from yours will the programing be the same. you need to make a new color sensor video maybe this company would like to sponsor you.
not iced coffee this time xd
Gr8.
just like MATLAB
Functions are a bit confusing for me
I understood all, good video, but what the heck is a grade? My dictionary told 1000 different explanations to me.
I found it, I think "Schulnote" is the rigth word in German.
Hey pls start making tutorials on IoT (internet of things). I wish be of great help to alot of people
Am still using the videos from the original series......Thanks you for keeping them up