Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write your own printArray() function found in Processing for the Arduino. For si

ID: 3888139 • Letter: W

Question

Write your own printArray() function found in Processing for the Arduino. For simplicity, you can limit printArray() to integer arrays and you will also pass the size of the array to your function. For example, given the following code int terps [5] {3, 9, 10, 1, 4); = void printArray (int arrayToPrintl], int arraySize) ( II YOUR CODE HERE void setup /I put your setup code here, to run once: Serial.begin (9600) void loop ) // put your main code here, to run repeatedly: printArray (terps,sizeof (terps)/sizeof (int)); delay (1000); You should repeatedly see the following in the serial monitor: [0]: 3 [4]: 4

Explanation / Answer

Ans:

void printArray(int arrayToPrint[], int arraySize)

{

int i;

for(i=0 ; i<arraySize ; i++)

{

print("%d ",arrayToPrint[i]);

}

}