this is not simple, as you mentioned when you want to use an array, you can't use it without for loop(i, i , i++) They all go hand in hand, so try to do better. thank you
This is purely a first principles 'look' at using an array for this use. Arrays can become more complex in usage with other concepts like loops etc.. You can make code work with a totally arbitrary array length such that you don't need to edit 100 line when you add an additional element to the array. You can made arrays multidimensional so each element of an array is itself an array of values (that would be called a 2d array, and you can keep going with 3d arrays etc..) In a simple case as shown, there is no difference / benefit. But in order to do the complex, you need to start with the basic.
On most chips it’s a false economy to use byte. You will load your byte on a 32 bit bus and maybe store it in a 128 bit register on the CPU to do math on it, so it just uses the same space as an integer anyway. The compiler will probably ignore you and use an integer. But yeah, I guess on an Arduino you can probably use Byte.
Love the way you explained array indexing!
Thanks a bunch!
A good introduction for beginners! Thanks for your effort to make this video.
Glad it was helpful!
Glad it was helpful!
This is too good and informative
I totally appreciate that!
this is not simple, as you mentioned when you want to use an array, you can't use it without for loop(i, i , i++) They all go hand in hand, so try to do better. thank you
The point of this video is to teach the basics on arrays. The next video in the series does use for loops.
I dont understand the benefit of using an array, vs just initializing individual variables.
This is purely a first principles 'look' at using an array for this use.
Arrays can become more complex in usage with other concepts like loops etc..
You can make code work with a totally arbitrary array length such that you don't need to edit 100 line when you add an additional element to the array.
You can made arrays multidimensional so each element of an array is itself an array of values (that would be called a 2d array, and you can keep going with 3d arrays etc..)
In a simple case as shown, there is no difference / benefit. But in order to do the complex, you need to start with the basic.
That's right, the point was to offer an introduction to arrays and get the basics of how they work.
On most chips it’s a false economy to use byte. You will load your byte on a 32 bit bus and maybe store it in a 128 bit register on the CPU to do math on it, so it just uses the same space as an integer anyway. The compiler will probably ignore you and use an integer. But yeah, I guess on an Arduino you can probably use Byte.