Step 4: Arduino Code

1. The Arduino code has three main sections: declaration, initialization and then an inifinite loop.
2. In the declaration section, set up global constant variables such as start and end bits for recieved signals and color declarations.
3. In the initialization section do following: set up contact by sending a start signal over the serial lines and set all the GPIO pins to be used to be in Digital Out mode so that they can drive the LEDS.
4. In the loop create two states: waiting for input and writing to the LEDS.
5. On the wait step, use delay(100) to make the Arduino board pause for 100 miliseconds
6. In the write phase, make the Arduino do the following:
a) Get the start flag, end flag, city(integer corresponding to a base pin) and color from the serial line and assert that the flags are correctly set.
b) Write a color to a specific city by first turning that city off and then using the color to turn on a combination of pins which correlate to an RGB color scheme from the base pin.

Our code for this step can be found at https://github.com/ianisborn/TTT/tree/master/sandbox
<p>Help I need a vector file for a topographic map, and the link in the text isn't working. </p>
Hi JodyP16, sorry the link isn't working! The vector file might be on my old computer, so I'll check there sometime this week.<br><br>If you need a vector file faster than that, you might want to just make your own. I was able to make mine in a couple hours by tracing the levels on a map.
Thank You!
<p>Hey, here's the updated link: <a href="https://drive.google.com/open?id=0B3lu9jVIssuPT1RkRXE3YmRvbUU" rel="nofollow">https://drive.google.com/open?id=0B3lu9jVIssuPT1Rk...</a></p><p>Each line in the file corresponds to a layer of the map</p>
<p>great post! thanks :-)</p>
WOW You have blown my mind with this idea, I just joined the site, browsed around didn't click on projects properly, then saw this and I had to check it out.<br><br>It's a brilliant concept and what a way to use the open source Arduino stuff. <br><br>Cool idea, good job!
Where did you download the Topo of your state? Please list a link.
I found it through Google Image search. I just added a link to a zipped folder of my images/vector files on the 'getting the map ready for cutting' step.
You can also download free topo maps from the usgs.gov website. <br>Excellent project!
Wow, and they said CU students just ride bikes, rock climb, drink in excess and burn furniture! Way to go guys, really KOOL project!

About This Instructable




More by ianisborn:TwitMap: Topographical Colorado Twitter Map 
Add instructable to: