OK, that worked. Thankfully, clicking the File --> New --> Arduino Sketch sequence provides a “Default cpp File” option. So, it still does the work of pulling in the correct board-dependent stuff. I could never configure all the toolchain and compiler options stuff myself.
Anyway, for this simple-minded example I didn’t even need .h file.
.cpp file:
#include "Arduino.h"
enum animal {dog, cat, pig, horse, cow};
animal returnAnimal(animal);
void setup() {
Serial.begin(115200);
delay(2000);
Serial.println(returnAnimal(dog));
}
void loop() {
}
animal returnAnimal(animal x) {
return x;
}
So, I owe you $1. Send me your Venmo ID ;D