// Setup 2 Arrays
int MyArray1[5] = {10,20,30,40,50};
int MyArray2[10] = {101,102,103,104,105,106,107,108,109,110};
int arraySize; // Variable to store No of elements in array
void printArray(int array[], int size){
for(int index = 0; index < size; index++){
Serial1.print(array[index]);
Serial1.print(", ");
}
Serial1.println();
}
void setup() {
// put your setup code here, to run once:
Serial1.begin(115200);
Serial1.println("Hello, Raspberry Pi Pico!");
Serial1.println("Array1");
arraySize = sizeof(MyArray1)/sizeof(MyArray1[0]); // Get number of elements in array
printArray(MyArray1, arraySize); // send array and size to function
Serial1.println("Array2");
arraySize = sizeof(MyArray2)/sizeof(MyArray2[0]);
printArray(MyArray2, arraySize);
}
// ignore this as its needed for pico to compile
void loop() {
delay(1);
}