So, I’ve been playing around with the SoOnCon badge over the past couple weeks, but I’ve hit what I think is a problem with my board.
It started when I was looking at the code that defines the switches (SoonCon2010Badge.h) and saw this:
#define SWITCH_0 0 #define SWITCH_1 1 #define SWITCH_2 35 #define SWITCH_4 7
Yes, that’s right, the switches are numbered 0, 1, 2 and 4. A little odd, but I decided that I should investigate farther.
I wrote a test program that would check the statuses of these switches and blink the red segment of the LED on the top differently depending on which switch was depressed. I remembered hearing that the switches had internal pull-up resistors, so their normal (open) state would be high.
I set up the blinking patterns like so:
|Switch Depressed||Number of Blinks|
What I’ve discovered from playing with this is that the switch on the bottom left is
SWITCH_1 and the switch on the bottom right is
SWITCH_4. I’m assuming that the switch on the top right is
SWITCH_2, but according to my program, it is continuously depressed, and
SWITCH_0 (I’m assuming this to be the reset pin) is never depressed.
I suspect that this is a problem with my board rather than a problem with my code.
If there’s anyone else out there who’s been able to compile and install new firmware onto their badge, can they do me the favour of trying my code out and describing the blinking patterns they see?
The code is on github (the switch-test branch). It can be found here.
This issue has been resolved. I found a patch on the original sourceforge page that I have imported into the git repository.