Great info. You are absolutely right to be concerned about inserting element values outside the size of your array. I learned first-hand you should always always always specify the size of your array when initializing. I spent several hours re-reading a multi-array code before I finally found the typo that bricked two Nanos by changing a value Beyond its array size. Fortunately I was able to salvage them by reloading their bootloader. However if I had specified the size of the array, the typo would have been caught when compiling and would have saved me hours of trouble.
@mariaviklund45466 ай бұрын
I was banging my head trying to get this to work on a project before i found this video. Now i know what i did wrong. Mixed the data types! Thanks so much!
@programmingelectronics6 ай бұрын
So glad it helped!!!
@tohcp5729 Жыл бұрын
it is great thing to learn and ready "open my eyes " and how the person created the so interesting guiding in Arduino programming way ...keep up
@programmingelectronics Жыл бұрын
Awesome! Thank you!
@KW-ei3pi7 ай бұрын
Love your channel. It's probably the best source of videos for Arduino instruction. I've been watching your videos for about a year. I was wondering where you are from, as you have different way of pronouncing the word "put". It was very noticeable in this video. Thanks. Regards
@programmingelectronics7 ай бұрын
Thanks! I'm from the midwest, but I just say "put" wrong 😀 I have no idea how I lived over 4 decades saying it incorrectly, but I am working on it! I don't even play golf.
@pboston6RR4 ай бұрын
WELL DONE! Now I’m ready to use arrays. Thanks!
@programmingelectronics4 ай бұрын
Great!
@ChadKapper3 жыл бұрын
This a super-valuable lesson! Thank you!
@programmingelectronics3 жыл бұрын
Thanks Chad!
@voytechj3 жыл бұрын
@7:10 other elements will be initialized with default value, and for a type of byte it will be zero.
@leythecg3 жыл бұрын
Very well explained! Thanks very much!
@programmingelectronics3 жыл бұрын
Thanks so much!!
@jlr3636 Жыл бұрын
Your explanation of what you are going is very clear, however an example of why or where to use an array escapes me. An example would help. Your videos on Arduino are among the best, thanks.
@peterlyne9378 Жыл бұрын
Thank you so much, very well explained
@felixcosty3 жыл бұрын
Thanks for the video. Could you please do a video on the joystick library. Trying to convert an old analog joystick to digital using a pro micro. Could you show how to program the Hat, and triggers/switches so that the triggers and switches work like joystick switchers. Right now my switches work as keyboard commands trigger = A and so on. I have seen short programs that make the switches act as joystick commands, would like to see the longer version where each switch is its own bit of code. Hope this makes sense.
@programmingelectronics3 жыл бұрын
Glad you liked the vid! Thanks for the recommendation on the joy stick library!
@tharchit902811 ай бұрын
THANKS MY DEAR !
@programmingelectronics11 ай бұрын
Thanks for watching!
@joshuapitong8992 жыл бұрын
Really helpful.🙌
@programmingelectronics2 жыл бұрын
Glad it was helpful!
@jaysonbutcher11782 жыл бұрын
Thank you! You explain it well. ;)
@programmingelectronics2 жыл бұрын
Thanks so much for the note!!
@midianalbertokhaiyow81953 жыл бұрын
excellent video, I have a question, let's imagine I have many arrays, let's say those have names like red blue green, and each array has several elements that in some cases can be as few as 7 or 10, and in other cases they are as large as 300 elements, In the main function, what it does is take an array as for example the "green" one and execute anything with the elements, such as adding the elements to each other or subtracting them, that is not really the important thing, the important thing is that I want to learn is how to change the array that is being used in the function through serial communication, for example, command by serial communication "red" and in the main function it is executed but in this case instead of using the "green" array use the "red" and if I write "blue" then change the "red" for "blue" ...
@programmingelectronics3 жыл бұрын
Great question! I’ll see if we can come up with a video to help on this. You might consider using a switch case statement to select the appropriate array based on the serial input.
@midianalbertokhaiyow81953 жыл бұрын
@@programmingelectronics Hello, thanks for your answer, I did not consider using a switch case, because there are too many arrays, neither consider using an array of arrays, because of the big difference between the content of arrays, since some contain few elements (4 or 10) and others contain many elements (300 or 400). I suppose that I could use pointer methods, what I am not clear about is how to convert a string sent by serial as "red" to a pointer, and then be able to use the pointer to fill it with the content of the "red" array and execute the code
@bassman21623 жыл бұрын
@@midianalbertokhaiyow8195 put the array names in a switch case that calls different functions depending on the color (array name). Then write a function to handle that array. If some of the functions do similar things, pass arguments to the function to determine how it process the passed array.
@programmingelectronics3 жыл бұрын
@@midianalbertokhaiyow8195 I was thinking what @Bass Man mentioned below, but I may not fully understand what you're after. Sounds like a cool application though! We do have several lessons on using serial input on KZbin that may be helpful on this potentially. Best of luck!
@NautilusAdventures18 ай бұрын
Really video, thanhs !
@learn37153 жыл бұрын
Great upload video! 👍 stay connected! 😍Like 👍👍👍
@programmingelectronics3 жыл бұрын
Thanks so much!
@platine1413 жыл бұрын
Is it possible to just pick up elements from 0 to 4 for example like in python? And why my array shows double the size of its elements? I didn't set the size of it
@programmingelectronics3 жыл бұрын
Great questions! 1) I believe you you are referring to "slicing" an array? Like you would with a list in python? myArray[] = { 10, 20, 30, 40, 50 } where... myArray[0:2] would give you the elements 10, 20 ->To my knowledge you cannot slice arrays like this with Arduino. 2) How are you finding the size of your array? Are you using the sizeof operator? If you use sizeof() it will return the number of total bytes in your array, not the total number of elements it can store. If you want to get the size of your array, you need to divide the sizeof(myArray) / sizeof(myArray[0] -> this will give you the actually size of the array.
@senpuuxd1032 Жыл бұрын
How to remove something from array? I want remove uid tag from 2 dimensional array after he was scaned and compare to array i don't know how to so this and can't find simple (to me) way
@Dartheomus Жыл бұрын
It is killing me not to know where 155 came from. It's not an arbitrary value... it must have derived it from something. =P
@karimazeli26532 жыл бұрын
Why not start with a Hardware example? That would make it less abstract, because we end up building physical things, not just software programming...
@billferner67417 ай бұрын
Maybe this helps? I use it in a temperature measurement for calculating the average of 10 masurements. Each new data point is put in a different position of that array. Then computet the sum, decided by 10. Voila, the average temperature.
@billferner67417 ай бұрын
I miss an example of a two-dimensional array.
@planker2 жыл бұрын
Like! Zero, accept it and move on... It's the stupid machine that thinks it's a number, ie; 1001011. 0 has a value to it. Machines also think Green is a primary Color. Stupid machines.
@gaptoofgranny Жыл бұрын
I know you need to run ads in your videos in order to make a living, I get that, but you need to either place the ad before the lesson or after. Some of us need to keep the lesson going in one continuous stream, otherwise our methods of processing information in order to learn it gets disrupted and we have to start all over again. It really is bad practice. I couldn't do that when I was teaching, otherwise my students would look at me like I grew a second head and get absolutely thrown for a loop.