Event problem

Hi guys.
Can somebody tell me how to use an Event in a function in another header.
For example I want to write below code in new header and then use it in main.ino .
Very thank you.

#include <Wire.h>
void setup()
{
      Wire.onRequest(requestEvent); // register event
}

void requestEvent()
{
  Wire.write("hello "); // respond with message
}

Never call an ino "main it interferes with the correct functioning of things.

What do you mean by "event"?

Mark

Moderator edit: LANGUAGE.

event , I mean "event function" in Microcontrollers.

Tell us what you want to achieve and not how you think it might be done.

I mean "event function" in Microcontrollers.

Sorry, but I don't know what that means.
What causes the "event" to happen ?
Is the "event" an interrupt routine or just a function call ?
(There is a huge difference in what should happen in each of them)

...R

yes, that is an interrupt routine , and I want to use an interrupt routine in a function in a new header.
Of course it should be defined in a static method in my new header.but how?

leoncorleone:
Of course it should be defined in a static method in my new header.but how?

Closely related to your Static method thread, that you started recently?

leoncorleone:
For example I want to write below code in new header and then use it in main.ino .

You want to write it, and you have written it. What is the problem?

Yes , I don't know what is wrong with Arduino IDE.
I have heard that I should use static word in my class, but It has error when I compile it.
Can you Cite me an example how to do this?
Thanks.

Yes , I don't know what is wrong with Arduino IDE.

Nothing. It's the operator.

@leoncorleone, please don't create several Threads all related to the same project. One Thread is quite sufficient for one project and then everyone can easily see all the related information.

...R