Arduino: A Step-by-Step Guide for Absolute Beginners by Daniel Bell

Arduino: A Step-by-Step Guide for Absolute Beginners by Daniel Bell

Author:Daniel Bell [Bell, Daniel]
Language: eng
Format: epub
Published: 2019-12-14T17:00:00+00:00


int an_array[5] = {12, 11, 9, 14, 97};

We have then used the variable x to iterate through the elements of the array. At each iteration, the code will print will print the value stored at a particular index of the array. The code will return all the 5 integers stored in the array. Consider the next example given below:

void setup() {

int an_array[5]; // an array to store 5 integer elements

int x;

Serial.begin(9600);

an_array[0] = 12; // assign a value of 12 to the 1st element

an_array[1] = 11; // assign a value of 11 to the 2nd element, etc.

an_array[2] = 9;

an_array[3] = 14;

an_array[4] = 97;



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.