This shows you the differences between two versions of the page.
user:jcavalu3:portfolio:datacomm2 [2013/11/13 19:27] – created jcavalu3 | user:jcavalu3:portfolio:datacomm2 [2013/11/13 19:31] (current) – jcavalu3 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | =====Binary Counter===== | ||
+ | In this project, I created a binary counter using the GPIO pins on my raspi. | ||
+ | |||
+ | The program: | ||
+ | |||
+ | <code c> | ||
+ | 1 #include " | ||
+ | 2 #include < | ||
+ | 3 | ||
+ | 4 int main() | ||
+ | 5 { | ||
+ | 6 | ||
+ | 7 char *binary, count = 0, holder = 0; // array to hold bit values, variable to check the counter, variable to compare values | ||
+ | 8 | ||
+ | 9 int i; // variable to control loop that sets pins on or off | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | It successfully runs a binary counter which sets the LED's on or off depending on the value stored in the corresponding location of data in the array. |