Internet Controlled Scrolling Numitrons
.
Featured here : http://mbed.org/blog/entry/119/ and http://hackaday.com/2010/02/12/internet-controlled-scrolling-numitron/
Ok, so after recieving an mbed as a gift I couldn't wait to get it do something, anything.
This quick test project took just a couple of hours to complete and is my first foray into microcontrollers... a battery powered mbed web client and numitron ticker.
I had some numitrons lying around (only three, I know, but it's all I had to hand) left over from a previous project, these nixie look-a-like 7 segment displays run off < 5V, I wired them directly to the mbed. No additional electronics to drive huge numbers of displays here. Just quick and dirty hackery with each segment of each of the three displays directly connected to an mbed digital-out pin (there's 30 of them). Simple.
Here's my code
#include "mbed.h" #include "HTTPClient.h" HTTPClient http; DigitalOut numitron[3][7] ={ {p5,p6,p7,p8,p9,p10,p11}, // output pins {p12,p13,p14,p15,p16,p17,p18}, {p19,p20,p21,p22,p23,p24,p25} }; void show(int display, int letter) { int charac[26][7]={ // SEGMENTS: A B C D E F G {1,1,1,0,1,1,1}, // 0 : A {1,1,1,1,1,1,1}, // 1 : B {1,0,0,1,1,1,0}, // 2 : C {1,1,1,1,1,1,0}, // 3 : D {1,0,0,1,1,1,1}, // 4 : E {1,0,0,0,1,1,1}, // 5 : F {1,0,1,1,1,1,0}, // 6 : G {0,1,1,0,1,1,1}, // 7 : H {0,0,0,0,1,1,0}, // 8 : I {0,1,1,1,1,0,0}, // 9 : J {0,1,1,0,1,1,1}, //10 : K {0,0,0,1,1,1,0}, //11 : L {1,1,1,0,1,1,0}, //12 : M {1,1,1,0,1,1,0}, //13 : N {1,1,1,1,1,1,0}, //14 : O {1,1,0,0,1,1,1}, //15 : P {1,1,1,1,1,1,0}, //16 : Q {1,1,1,0,1,1,1}, //17 : R {1,0,1,1,0,1,1}, //18 : S {0,0,0,1,1,1,1}, //19 : T {0,1,1,1,1,1,0}, //20 : U {0,1,1,1,1,1,0}, //21 : V {0,0,0,0,0,0,0}, //22 : W {0,0,0,0,0,0,0}, //23 : X {0,1,1,1,0,1,1}, //24 : Y {1,1,0,1,1,0,1} //25 : Z }; for(int i=0;i<7;i++) { numitron[display][i]=charac[letter][i]; } } int main(void) { char s[64]; int strlength; while(1) { for (int j=0;j<64;j++) { s[j] = '\0'; } http.get("http://192.168.0.1/test/text.txt", s); strlength = strlen(s); //pad with blanks s[strlength+1]="X"; s[strlength+2]="X"; s[strlength+3]="X"; for (int j=0;j<strlength;j++) { show( 2, s[j]-65); show( 1, s[j+1]-65); show( 0, s[j+2]-65); wait(0.36); } } }
0 comments
You need to log in to post a comment