Introduction
One of my good friends and I were at the local climbing gym staring at a moon board, when we (and by we, I mean he) had a great idea. What if the climbing holds were lit up by LEDs to indicate which ones were fair game? This would eliminate the need to memorize where the hold was and what it looked like. This way when you were climbing, and holding onto the wall with everything that you had, you didn’t need to fumble around for where to go next. It would be very obvious because it would be lit up.
The more we started talking about this the more that we thought about making clear holds, and lighting up the entire hold. (As opposed to putting a light above/below the hold.) Even better, you could climb at night, so that the holds would jump out at you. Then it would be impossible to “mistakenly” grab the wrong hold.
When I got home, I found out that someone had already patented the idea of illuminated rock climbing holds, which is good news because that means that it could one day be a reality.
Building
So, I set about to build a way to use the BeagleBone to light up a sequence of LEDs to show the route to go up the wall. To do this, I followed this great tutorial on how to use a 74HC595 shift register. The tutorial was written for the arduino, but the circuit diagrams are easily transferrable – all that changes is what GPIO ports to connect to.
The code is a bit different though. I was unable to find an analogous function for shiftOut, which seemed to be the heart of the program. After a couple of attempts to write my own, I decided to just hard code the routes into the program and include an easy, medium and hard route. Here are what the three routes look like:
Easy | Medium | Hard |
---|---|---|
Here’s a quick video of the step up:
To choose between the routes, there is a switch statement:
loop = function() {
digitalWrite(latchPin, LOW);
route = 1;
switch(route)
{
case 1:
easyRoute();
break;
case 2:
mediumRoute();
break;
case 3:
hardRoute();
break;
}
digitalWrite(latchPin, HIGH);
};
At some point I’m hoping to improve it and have an up/down selector and a small multi-segment LED to display which route you’ve selected. The full code is attached, in case you were wondering how it was done.
Final Thoughts
I was pretty excited to use the cloud9 IDE it looked really nice and seemed like it was going to make programming a breeze. Unfortunately, that was not the case. I ran into two problems.
First, I could only get the program to run once through the debugger. After that the BeagleBone seemed to be unresponsive. In order to get it to run again, I had to restart the BeagleBone. Not sure what the problem was, but this made it very difficult to debug. I quickly scrapped this method and ended up just writing the code in cloud9 and running the program through PuTTY. Not ideal, but it was certainly better than restarting every time.
Second, the cloud9’s inability to properly flag errors was annoying. It seemed to claim that every line was in error, but it would run just fine. For someone who doesn’t know javascript very well, this made it pretty difficult to try to figure out whether there was a problem in the code or not. I also had problems figuring out what commands were built into bonescript.
Overall, not the smoothest project, but it seemed to work in the end.