invalid conversion from 'int' to 'void (*)()' [-fpermissive]

Alright, when I verified it, I got this error message:

F05WE4KIG11YTGV.ino: In function 'void setup()':

F05WE4KIG11YTGV.ino:237:54: error: invalid conversion from 'int' to 'void (*)()' [-fpermissive]

And after many confused minutes, I got nothing. So, here's my 'void setup()', so please tell me what I did wrong:

void setup(){
 pinMode(buttonPin,INPUT);
 pinMode(PIN_READWRITE, OUTPUT);
 digitalWrite(PIN_READWRITE, LOW);
 pinMode(PIN_CONTRAST, OUTPUT);
 digitalWrite(PIN_CONTRAST, LOW);
 pinMode(PIN_BUTTON, INPUT);
 digitalWrite(PIN_BUTTON, HIGH);
 pinMode(PIN_AUTOPLAY, OUTPUT);
 digitalWrite(PIN_AUTOPLAY, HIGH);
 
 // Digital pin 2 maps to interrupt 0
 attachInterrupt(0/*PIN_BUTTON*/, buttonPin, FALLING);
 
 initializeGraphics();
 
 lcd.begin(16, 2);

}[/color]

You're kidding, right? You're expecting someone here to do... what?

Regards,
Ray L.

Sorry, I miss clicked and couldn't fix that color for 5 minutes. Its fixed now.

The attachinterrupt thing has a /* comment */ right in the middle of it.

The second argument to attachInterrupt is a pointer to the function that handles the interrupt. You are are passing buttonPin, which is obviously an int.

READ the first post in the forum: "How to use this forum - please read!"

Regards,
Ray L.

Dan95:
The attachinterrupt thing has a /* comment */ right in the middle of it.

That is actually not a problem...

attachInterrupt takes a function as a parameter, and you are passing it an int.

  attachInterrupt(0/*PIN_BUTTON*/, buttonPin, FALLING);

What are you trying to do here? When the interrupt on pin 0 falls, you want the arduino to … what? You want it to buttonPin? What does that mean?

setup() {
  attachInterrupt(0/*PIN_BUTTON*/, doThisWhenInterrupt0Falls, FALLING);
}

void doThisWhenInterrupt0Falls() {
  // some code here
}

RayLivingston:
The second argument to attachInterrupt is a pointer to the function that handles the interrupt. You are are passing buttonPin, which is obviously an int.

Alright, my code is now:

pinMode(buttonPin,INPUT);
  pinMode(PIN_READWRITE, OUTPUT);
  digitalWrite(PIN_READWRITE, LOW);
  pinMode(PIN_CONTRAST, OUTPUT);
  digitalWrite(PIN_CONTRAST, LOW);
  pinMode(PIN_BUTTON, INPUT);
  digitalWrite(PIN_BUTTON, HIGH);
  pinMode(PIN_AUTOPLAY, OUTPUT);
  digitalWrite(PIN_AUTOPLAY, HIGH);
  
  // Digital pin 2 maps to interrupt 0
  attachInterrupt(0, int buttonPin, FALLING);
  
  initializeGraphics();
  
  lcd.begin(16, 2);

Which solved my previous error, but it causes this error:

expected primary-expression before 'int'

RayLivingston:
That is actually not a problem...

I see that now that you mention it, duh, not sure what I was thinking.