//Program: Pico_MultiCore01.ion
// Demonstrates a simple use of the setup1()/loop1() functions
// for a multiprocessor run.
// Will output something like, where C0 is running on core 0 and
// C1 is on core 1, in parallel.
int counter0 = 1;
int counter1 = 1;
// The normal, core0 setup
void setup() {
delay(5000);
Serial1.begin(115200);
Serial1.println("CPU0 Start.... ");
}
void loop() {
delay(2000);
Serial1.print("CPU0 run: counter0 =");
Serial1.println(counter0);
counter0++;
}
// Running on core1
void setup1() {
delay(5000);
Serial1.println("CPU1 Start..... ");
}
void loop1() {
delay(4000);
Serial1.print("CPU1 run: counter1 =");
Serial1.println(counter1);
counter1++;
}