All things Raspberry Pi and Time Lapse

Posts tagged ‘C’

Gertboard LED test scripts

I originally tested the Gertboard using the C code. But then when it came to modifying it I am not very familiar with C. So I downloaded the Python code available here from raspi.tv and it worked great! I was able to modify it and made some of my own visualizations and rewrote some of the current ones for the fun of it. The first couple are pretty basic. The last one shown in this video (about 0:52 seconds ) randomly chooses one of the LEDs and then creates two different “lives” on either side of that LED. Each time through the loop each life can move up or down. So one can move up and the other move down, or they might both move in the same direction. This continues until one of them tries to move to LED 0 or 13 which doesn’t exist, and then they die. But the other one continues until it also tries to move to 0 or 13. On the screen it prints out how many times it moved. Best I have seen using the LEDs is over 200. But just running the code on the computer without the delay I have seen over 640 moves without dying.

http://vimeo.com/58221381

Interesting and fun stuff!!

Tag Cloud