extern "C" {
// the function from the C program we want to call
extern int answerToLife();
// the function that we want to be visible in the C code
int halfAnswerToLife() {
Serial.println("in halfAnswerToLife");
return 21;
}
}
void setup() {
Serial.begin(115200);
int anwser = answerToLife();
Serial.print("The answer to life, the universe, and everything is ");
Serial.println(anwser);
}
void loop() {}