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.
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]]
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?
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?
Important Information for this Arm website
This site uses cookies to store information on your computer.
By continuing to use our site, you consent to our cookies.
If you are not happy with the use of these cookies, please review our
Cookie Policy
to learn how they can be disabled.
By disabling cookies, some features of the site will not work.
Access Warning
You do not have the correct permissions to perform this operation.
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