Interrupt Wait Method

08 Sep 2011

I have some code that works fine without the wait statement. All it does is turn an LED on and off. I am calling methods across classes because I am testing skeleton code and will build it up its intended purpose. Anyway, the problem is with the wait statement. The LED turns on when the button is pushed, but does not turn off. Basically, the program locks up. Here is the code for each class. Is there a memory issue or something?

The files I have attached. They are header and class files with the code renamed as text files since the site does not premit the upload of *.cpp or *.h files.

/media/uploads/kingneb/main.cpp.txt

/media/uploads/kingneb/buttoninterrupt.cpp.txt

/media/uploads/kingneb/i2cclasses.cpp.txt

/media/uploads/kingneb/buttoninterrupt.h.txt

/media/uploads/kingneb/i2cclasses.h.txt

08 Sep 2011

The wait statement and interrupts seem to hate each other because putting one in main() causes the program to stop working as well.

09 Sep 2011

Does not work.

09 Sep 2011

I figured it out, the problem was that I had to make the InterruptIn class visible to the whole class, not just the constructor. Why is this?