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]: 4Explanation / Answer
Ans:
void printArray(int arrayToPrint[], int arraySize)
{
int i;
for(i=0 ; i<arraySize ; i++)
{
print("%d ",arrayToPrint[i]);
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.