Timer/attachInterrupt not working

Hello, I am not sure why this is not working. My teacher had an example in class where only one argument was in his attachInterrupt function and it worked. Can someone please help me? Thank you :slight_smile:

Lab 2
#include <TimerThree.h>

int windPin = A0;
int lightPin = A1;
int airPin = A2;

int avgWindVal = 0;
int avgLightVal = 0;
int avgAirVal = 0;

bool test = true;

void setState(String state); //sets state to "test" or "normal"
void updateVals(); // updates the average values of the variables
int getAvgMinVals(); //gets the average values over a minute
int getAvg10MinVals(); //gets average values over 10 minute
int readInputs();

void setup() {

pinMode(windPin, INPUT);
pinMode(lightPin, INPUT);
pinMode(airPin, INPUT);

int tenSecs = 10000000;
int oneMin = tenSecs * 6;
int tenMin = oneMin *10;

Timer3.initialize(tenSecs); //timer set to 10 sec.

void loop() {


void setState(String state){
if(state == "test"){
test = true;
}else if(state == "norm"){
test = false;

void updateVals(){

int getAvg10MinVals(){
return 0;
int getAvgMinVals(){
const int size = 6; //6 readings every min
return 0;

void readInputs(int wind[], int light[], int air[], int size){

To post errors copy the error message using the copy error message button (in the IDE, lower right of the IDE window) and paste the error into a new post in code tags. See the forum guidelines to see how to use code tags for error messages and code.

I don't think that an ISR can have arguments nor can it return a value. Set a flag in the ISR to call a function in loop(), then clear the flag when done.

Interrupts are disabled during an ISR. Serial print uses interrupts. Don't print in an ISR (or use delay()).

Did this example come from your teacher?

If so, you are being taught using very bad examples. In addition to the above comment about NOT printing within an interrupt, interrupt routines DO NOT have call arguments.

Avoid using Strings on standard Arduinos. They can cause program crashes.