5 by 40 multi-color LED display with digital/magic LED strips http://www.youtube.com/watch?v=Txduzhp29fQ
Revision 1:77d32b0c953c, committed 2011-11-06
- Comitter:
- LNSound
- Date:
- Sun Nov 06 18:48:15 2011 +0000
- Parent:
- 0:a7ec991a632c
- Commit message:
- 1.1 cleaned up code and added explaination
http://www.youtube.com/watch?v=Txduzhp29fQ
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r a7ec991a632c -r 77d32b0c953c main.cpp --- a/main.cpp Sun Nov 06 18:13:38 2011 +0000 +++ b/main.cpp Sun Nov 06 18:48:15 2011 +0000 @@ -1,8 +1,5 @@ #include "mbed.h" - - -//PwmOut CLK(p21); // pwm als klok, minimale pulsbreedte klok 300ns ofwel 3.33MHz max freq. -PwmOut fade(p22); // voor faden van leds. +PwmOut fade(p22); // voor faden van leds, not used. DigitalOut latch(p19); DigitalOut data(p20); DigitalOut clk(p18); @@ -12,8 +9,6 @@ DigitalOut s4(p14); DigitalOut s5(p13); -//SPIHalfDuplex master(p5, NC,p7); - /* Bit # Meaning 7 Latchable. A 1 here makes the byte latachable, otherwise the byte is considered void and wont latch into the LED. @@ -34,6 +29,23 @@ After setting the datapin, you must wait at least 250nSec for each LED in your strip BEFORE taking clock high. 100 LEDS = 100 x 250nSec delay between sending last bit of data and taking latch high */ +/* Color values: +Blue : 0x81 +Red : 0x84 +Green: 0x94 +Pink : 0x8D +White: 0x95 + +Method of controlling. + +First activate line 1 to 5 using s1 to s5. s1=0 -> line is active s1=1 -> line is deactivated. +one LED is one RGB pixel. Send a value using sendbyte(), then use send_position() to activate the led on the chosen position. + +Want to send a letter? +e.g. A(0,0), this means letter A to position 0 and color RED, RED is starting color. What you type behind the first brace is the position, to change the color type the difference with color value and red. This will be added in the function. +Starting position of all letters is the third led on the strip, this is done because of building purposes. +*/ + DigitalOut myled(LED1); @@ -117,7 +129,7 @@ s4=0; s5=0; - for(int i=0 ; i < x ; i++) // alle leds uitzetten + for(int i=0 ; i < x ; i++) // x aantal leds uitzetten. { sendByte(128); @@ -167,23 +179,21 @@ s3=0; sendByte(0x84+kleur); send_position(4+pos); - s3=1; s4=0; - - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(3+pos); s4=1; s5=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); sendByte(0x84+kleur); send_position(5+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(6+pos); s5=1; @@ -196,35 +206,29 @@ void Y(int pos, int kleur) { - s1=0; - sendByte(0x84+kleur); + s1=0; + sendByte(0x84+kleur); send_position(2+pos); sendByte(0x84+kleur); send_position(6+pos); - s1=1; s2=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(5+pos); s2=1; s3=0; sendByte(0x84+kleur); send_position(4+pos); - s3=1; s4=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); - s4=1; s5=0; sendByte(0x84+kleur); send_position(4+pos); - - - s5=1; ///*** Eind Y **** /// @@ -235,28 +239,26 @@ void X(int pos, int kleur) { - s1=0; - sendByte(0x84+kleur); + s1=0; + sendByte(0x84+kleur); send_position(2+pos); sendByte(0x84+kleur); send_position(6+pos); - s1=1; s2=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(5+pos); s2=1; s3=0; sendByte(0x84+kleur); send_position(4+pos); - s3=1; s4=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(5+pos); s4=1; s5=0; @@ -264,8 +266,6 @@ send_position(2+pos); sendByte(0x84+kleur); send_position(6+pos); - - s5=1; ///*** Eind X **** /// @@ -276,25 +276,23 @@ void W(int pos, int kleur) { - s1=0; - sendByte(0x84+kleur); + s1=0; + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(6+pos); s1=1; s2=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(6+pos); s2=1; s3=0; sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); send_position(6+pos); - s3=1; s4=0; sendByte(0x84+kleur); @@ -303,14 +301,13 @@ send_position(4+pos); sendByte(0x84+kleur); send_position(6+pos); - s4=1; s5=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(5+pos); - s5=1; + s5=1; /// ***** Eind W ***/ @@ -320,35 +317,34 @@ void V(int pos, int kleur) { - s1=0; - sendByte(0x84+kleur); + s1=0; + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(6+pos); s1=1; s2=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(6+pos); s2=1; s3=0; sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(6+pos); s3=1; s4=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(5+pos); s4=1; s5=0; - - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); - s5=1; + s5=1; /// ***** Eind V ***/ @@ -357,36 +353,36 @@ void U(int pos, int kleur) { - s1=0; - sendByte(0x84+kleur); + s1=0; + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(5+pos); s1=1; s2=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(5+pos); s2=1; s3=0; sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(5+pos); s3=1; s4=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(5+pos); s4=1; s5=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); - s5=1; + s5=1; /// ***** Eind U ***/ @@ -394,39 +390,34 @@ void T(int pos, int kleur) { - s1=0; - sendByte(0x84+kleur); - send_position(2+pos); + s1=0; + sendByte(0x84+kleur); + send_position(2+pos); + sendByte(0x84+kleur); + send_position(3+pos); + sendByte(0x84+kleur); + send_position(4+pos); + sendByte(0x84+kleur); + send_position(5+pos);; + sendByte(0x84+kleur); + send_position(6+pos); + s1=1; + s2=0; sendByte(0x84+kleur); - send_position(3+pos); - sendByte(0x84+kleur); - send_position(4+pos); - - sendByte(0x84+kleur); - send_position(5+pos);; - sendByte(0x84+kleur); - send_position(6+pos); - s1=1; - s2=0; - sendByte(0x84+kleur); - send_position(4+pos); - - s2=1; - s3=0; - - sendByte(0x84+kleur); - send_position(4+pos); - - s3=1; - s4=0; - sendByte(0x84+kleur); - send_position(4+pos); - - s4=1; - s5=0; - sendByte(0x84+kleur); - send_position(4+pos); - s5=1; + send_position(4+pos); + s2=1; + s3=0; + sendByte(0x84+kleur); + send_position(4+pos); + s3=1; + s4=0; + sendByte(0x84+kleur); + send_position(4+pos); + s4=1; + s5=0; + sendByte(0x84+kleur); + send_position(4+pos); + s5=1; ///** Einde T ***/ @@ -437,39 +428,36 @@ void S(int pos, int kleur) { - s1=0; - - sendByte(0x84+kleur); + s1=0; + sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); sendByte(0x84+kleur); send_position(5+pos); s1=1; s2=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(2+pos); - s2=1; s3=0; sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); s3=1; s4=0; - - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(5+pos); s4=1; s5=0; sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); - s5=1; + s5=1; /// ***** Eind S ***/ @@ -479,36 +467,30 @@ void R(int pos, int kleur) { - s1=0; - sendByte(0x84+kleur); + s1=0; + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(3+pos); sendByte(0x84+kleur); send_position(4+pos); - s1=1; s2=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); - - s2=1; s3=0; sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(3+pos); - - - s3=1; s4=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); s4=1; s5=0; @@ -516,8 +498,6 @@ send_position(2+pos); sendByte(0x84+kleur); send_position(5+pos); - - s5=1; ///*** Eind R **** /// @@ -527,39 +507,38 @@ void Q(int pos, int kleur) { - s1=0; - sendByte(0x84+kleur); + s1=0; + sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); s1=1; s2=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(5+pos); s2=1; s3=0; sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(5+pos); s3=1; s4=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(5+pos); s4=1; s5=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(6+pos); - - s5=1; + s5=1; @@ -572,42 +551,35 @@ void P(int pos, int kleur) { - s1=0; - sendByte(0x84+kleur); + s1=0; + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(3+pos); sendByte(0x84+kleur); send_position(4+pos); - s1=1; s2=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); - - s2=1; s3=0; sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(3+pos); sendByte(0x84+kleur); - send_position(4+pos); - - + send_position(4+pos); s3=1; s4=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(2+pos); s4=1; s5=0; sendByte(0x84+kleur); send_position(2+pos); - - s5=1; ///*** Eind P **** /// @@ -617,36 +589,36 @@ void O(int pos, int kleur) { - s1=0; - sendByte(0x84+kleur); + s1=0; + sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); s1=1; s2=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(5+pos); s2=1; s3=0; sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(5+pos); s3=1; s4=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(5+pos); s4=1; s5=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); - s5=1; + s5=1; /// ***** Eind O ***/ @@ -655,48 +627,41 @@ void N(int pos, int kleur) { - s1=0; - sendByte(0x84+kleur); + s1=0; + sendByte(0x84+kleur); send_position(2+pos); sendByte(0x84+kleur); send_position(6+pos); - - s1=1; - s2=0; - + s1=1; + s2=0; sendByte(0x84+kleur); send_position(2+pos); sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); send_position(6+pos); - s2=1; - s3=0; - - sendByte(0x84+kleur); + s3=0; + sendByte(0x84+kleur); send_position(2+pos); sendByte(0x84+kleur); send_position(4+pos); sendByte(0x84+kleur); send_position(6+pos); s3=1; - s4=0; sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(6+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(5+pos); - s4=1; + s4=1; s5=0; sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(6+pos); - s5=1; ///*** Eind N**** /// @@ -707,44 +672,38 @@ void M(int pos, int kleur) { - s1=0; + s1=0; sendByte(0x84+kleur); - send_position(2+pos); - sendByte(0x84+kleur); - send_position(6+pos); - + send_position(2+pos); + sendByte(0x84+kleur); + send_position(6+pos); s1=1; s2=0; - - sendByte(0x84+kleur); - send_position(2+pos); - sendByte(0x84+kleur); - send_position(3+pos); - sendByte(0x84+kleur); - send_position(5+pos); - sendByte(0x84+kleur); - send_position(6+pos); - - s2=1; - s3=0; - - sendByte(0x84+kleur); - send_position(2+pos); - sendByte(0x84+kleur); - send_position(4+pos); - sendByte(0x84+kleur); - send_position(6+pos); - s3=1; - - s4=0; - - s5=0; - sendByte(0x84+kleur); - send_position(2+pos); - sendByte(0x84+kleur); - send_position(6+pos); - s4=1; - s5=1; + sendByte(0x84+kleur); + send_position(2+pos); + sendByte(0x84+kleur); + send_position(3+pos); + sendByte(0x84+kleur); + send_position(5+pos); + sendByte(0x84+kleur); + send_position(6+pos); + s2=1; + s3=0; + sendByte(0x84+kleur); + send_position(2+pos); + sendByte(0x84+kleur); + send_position(4+pos); + sendByte(0x84+kleur); + send_position(6+pos); + s3=1; + s4=0; + s5=0; + sendByte(0x84+kleur); + send_position(2+pos); + sendByte(0x84+kleur); + send_position(6+pos); + s4=1; + s5=1; ///*** Eind M**** /// @@ -755,31 +714,28 @@ void L(int pos, int kleur) { - s1=0; - sendByte(0x84+kleur); + s1=0; + sendByte(0x84+kleur); send_position(2+pos); s1=1; s2=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(2+pos); - s2=1; s3=0; sendByte(0x84+kleur); send_position(2+pos); - s3=1; s4=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(2+pos); s4=1; s5=0; sendByte(0x84+kleur); send_position(2+pos); sendByte(0x84+kleur); - send_position(3+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); sendByte(0x84+kleur); send_position(5+pos); @@ -792,17 +748,16 @@ void K(int pos, int kleur) { - s1=0; - sendByte(0x84+kleur); + s1=0; + sendByte(0x84+kleur); send_position(2+pos); - - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(5+pos); s1=1; s2=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); s2=1; s3=0; @@ -810,19 +765,17 @@ send_position(2+pos); sendByte(0x84+kleur); send_position(3+pos); - - s3=1; s4=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); s4=1; s5=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(5+pos); s5=1; @@ -832,79 +785,63 @@ void J(int pos, int kleur) { -s1=0; - - sendByte(0x84+kleur); + s1=0; + sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); - - s1=1; s2=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); - s2=1; s3=0; - sendByte(0x84+kleur); send_position(4+pos); - s3=1; s4=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); - s4=1; s5=0; sendByte(0x84+kleur); - send_position(2+pos); - sendByte(0x84+kleur); + send_position(2+pos); + sendByte(0x84+kleur); send_position(3+pos); - - s5=1; + s5=1; ///** Einde J ***/ } void I(int pos, int kleur) { - s1=0; - - sendByte(0x84+kleur); + s1=0; + sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); - - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(5+pos); s1=1; s2=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); - s2=1; s3=0; - ; sendByte(0x84+kleur); send_position(4+pos); - s3=1; s4=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); - s4=1; s5=0; - send_position(3+pos); - sendByte(0x84+kleur); + send_position(3+pos); + sendByte(0x84+kleur); send_position(4+pos); - - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(5+pos); - -///** Einde I ***/ +//** Einde I ***/ } @@ -913,17 +850,143 @@ { //// *** Begin H *** // s1=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); + send_position(2+pos); + sendByte(0x84+kleur); + send_position(5+pos); + s1=1; + s2=0; + sendByte(0x84+kleur); + send_position(2+pos); + sendByte(0x84+kleur); + send_position(5+pos); + s2=1; + s3=0; + sendByte(0x84+kleur); + send_position(2+pos); + sendByte(0x84+kleur); + send_position(3+pos); + sendByte(0x84+kleur); + send_position(4+pos); + sendByte(0x84+kleur); + send_position(5+pos); + s3=1; + s4=0; + sendByte(0x84+kleur); + send_position(2+pos); + sendByte(0x84+kleur); + send_position(5+pos); + s4=1; + s5=0; + sendByte(0x84+kleur); + send_position(2+pos); + sendByte(0x84+kleur); + send_position(5+pos); + s5=1; + + ///*** Eind H ***// +} +void G(int pos, int kleur) +{ + myled=1; + s1=0; + sendByte(0x84+kleur); + send_position(2+pos); + sendByte(0x84+kleur); + send_position(3+pos); + sendByte(0x84+kleur); + send_position(4+pos); + sendByte(0x84+kleur); + send_position(5+pos); + s1=1; + s2=0; + sendByte(0x84+kleur); + send_position(2+pos); + s2=1; + s3=0; + sendByte(0x84+kleur); + send_position(2+pos); + sendByte(0x84+kleur); + send_position(4+pos); + sendByte(0x84+kleur); + send_position(5+pos); + s3=1; + s4=0; + sendByte(0x84+kleur); + send_position(2+pos); + sendByte(0x84+kleur); + send_position(5+pos); + s4=1; + s5=0; + sendByte(0x84+kleur); + send_position(2+pos); + sendByte(0x84+kleur); + send_position(3+pos); + sendByte(0x84+kleur); + send_position(4+pos); + sendByte(0x84+kleur); + send_position(5+pos); + s5=1; + + /// *** Eind G *** / + +} + +void F(int pos, int kleur){ + + s1=0; + sendByte(0x84+kleur); send_position(2+pos); - - sendByte(0x84+kleur); + sendByte(0x84+kleur); + send_position(3+pos); + sendByte(0x84+kleur); + send_position(4+pos); + sendByte(0x84+kleur); send_position(5+pos); s1=1; s2=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); + send_position(2+pos); + s2=1; + s3=0; + sendByte(0x84+kleur); + send_position(2+pos); + sendByte(0x84+kleur); + send_position(3+pos); + sendByte(0x84+kleur); + send_position(4+pos); + sendByte(0x84+kleur); + send_position(5+pos); + s3=1; + s4=0; + sendByte(0x84+kleur); + send_position(2+pos); + s4=1; + s5=0; + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + s5=1; + + /// **** Eind F ****/// + +} + +void E(int pos, int kleur) +{ + + s1=0; + sendByte(0x84+kleur); + send_position(2+pos); + sendByte(0x84+kleur); + send_position(3+pos); + sendByte(0x84+kleur); + send_position(4+pos); + sendByte(0x84+kleur); send_position(5+pos); + s1=1; + s2=0; + sendByte(0x84+kleur); + send_position(2+pos); s2=1; s3=0; sendByte(0x84+kleur); @@ -932,146 +995,22 @@ send_position(3+pos); sendByte(0x84+kleur); send_position(4+pos); - sendByte(0x84+kleur); - send_position(5+pos); - s3=1; - s4=0; - sendByte(0x84+kleur); - send_position(2+pos); - sendByte(0x84+kleur); - send_position(5+pos); - s4=1; - s5=0; - sendByte(0x84+kleur); - send_position(2+pos); - sendByte(0x84+kleur); - send_position(5+pos); - s5=1; -} -void G(int pos, int kleur) -{ - myled=1; - s1=0; - sendByte(0x84+kleur); - send_position(2+pos); - sendByte(0x84+kleur); - send_position(3+pos); - sendByte(0x84+kleur); - send_position(4+pos); - sendByte(0x84+kleur); - send_position(5+pos); - s1=1; - s2=0; - sendByte(0x84+kleur); - send_position(2+pos); - s2=1; - s3=0; - sendByte(0x84+kleur); - send_position(2+pos); - sendByte(0x84+kleur); - send_position(4+pos); sendByte(0x84+kleur); send_position(5+pos); s3=1; s4=0; - sendByte(0x84+kleur); - send_position(2+pos); sendByte(0x84+kleur); - send_position(5+pos); - s4=1; - s5=0; - sendByte(0x84+kleur); - send_position(2+pos); - sendByte(0x84+kleur); - send_position(3+pos); - sendByte(0x84+kleur); - send_position(4+pos); - sendByte(0x84+kleur); - send_position(5+pos); - s5=1; - -} - -void F(int pos, int kleur){ - - s1=0; - sendByte(0x84+kleur); // - send_position(2+pos); - sendByte(0x84+kleur); // - send_position(3+pos); - sendByte(0x84+kleur); // - send_position(4+pos); - sendByte(0x84+kleur); // - send_position(5+pos); - s1=1; - s2=0; - sendByte(0x84+kleur); - send_position(2+pos); - s2=1; - s3=0; - sendByte(0x84+kleur); - send_position(2+pos); - sendByte(0x84+kleur); - send_position(3+pos); - sendByte(0x84+kleur); - send_position(4+pos); - sendByte(0x84+kleur); - send_position(5+pos); - s3=1; - s4=0; - sendByte(0x84+kleur); send_position(2+pos); s4=1; s5=0; - + sendByte(0x84+kleur); sendByte(0x84+kleur); send_position(2+pos); - s5=1; - - /// **** Eind F ****/// - -} - -void E(int pos, int kleur) -{ - - s1=0; - sendByte(0x84+kleur); // 1 rode led aan - send_position(2+pos); - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(4+pos); - sendByte(0x84+kleur); // 1 rode led aan - send_position(5+pos); - s1=1; - s2=0; - sendByte(0x84+kleur); // 1 rode led aan - send_position(2+pos); - s2=1; - s3=0; - sendByte(0x84+kleur); // 1 rode led aan - send_position(2+pos); - sendByte(0x84+kleur); // 1 rode led aan - send_position(3+pos); - sendByte(0x84+kleur); // 1 rode led aan - send_position(4+pos); - sendByte(0x84+kleur); // 1 rode led aan - send_position(5+pos); - s3=1; - s4=0; - sendByte(0x84+kleur); // 1 rode led aan - send_position(2+pos); - s4=1; - s5=0; - sendByte(0x84+kleur); // 1 rode led aan - sendByte(0x84+kleur); // 1 rode led aan - send_position(2+pos); - sendByte(0x84+kleur); // 1 rode led aan - send_position(3+pos); - sendByte(0x84+kleur); // 1 rode led aan - send_position(4+pos); - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(5+pos); s5=1; @@ -1079,38 +1018,38 @@ } void D(int pos, int kleur) { - s1=0; - sendByte(0x84+kleur); // 1 rode led aan + s1=0; + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(4+pos); s1=1; s2=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(5+pos); s2=1; s3=0; sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(5+pos); s3=1; s4=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(5+pos); s4=1; s5=0; - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); + sendByte(0x84+kleur); send_position(4+pos); s5=1; @@ -1120,31 +1059,31 @@ void C(int pos, int kleur) { s1=0; - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(4+pos); - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(5+pos); s1=1; s2=0; - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(2+pos); s2=1; s3=0; - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(2+pos); s3=1; s4=0; - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(2+pos); s4=1; s5=0; - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(4+pos); - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(5+pos); s5=1; @@ -1155,42 +1094,41 @@ { - s1=0; - sendByte(0x84+kleur); // 1 rode led aan + s1=0; + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(4+pos); s1=1; s2=0; - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(5+pos); s2=1; s3=0; - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(4+pos); s3=1; s4=0; - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(5+pos); s4=1; s5=0; - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(2+pos); - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(3+pos); - sendByte(0x84+kleur); // 1 rode led aan + sendByte(0x84+kleur); send_position(4+pos); - s5=1; //***** Eind B *****/ @@ -1201,39 +1139,35 @@ s1=0; - sendByte(0x84+kleur); // 1 rode led aan - send_position(4+pos); - + sendByte(0x84+kleur); + send_position(4+pos); s1=1; s2=0; - - sendByte(0x84+kleur); // 1 rode led aan - send_position(3+pos); - sendByte(0x84+kleur); // 1 rode led aan - send_position(5+pos); - s2=1; - s3=0; - - sendByte(0x84+kleur); // 1 rode led aan - send_position(2+pos); - sendByte(0x84+kleur); // 1 rode led aan - send_position(3+pos); - sendByte(0x84+kleur); // 1 rode led aan - send_position(4+pos); - sendByte(0x84+kleur); // 1 rode led aan - send_position(5+pos); - sendByte(0x84+kleur); // 1 rode led aan - send_position(6+pos); - s3=1; - - s4=0; - s5=0; - sendByte(0x84+kleur); // 1 rode led aan - send_position(2+pos); - sendByte(0x84+kleur); // 1 rode led aan - send_position(6+pos); - s4=1; - s5=1; + sendByte(0x84+kleur); + send_position(3+pos); + sendByte(0x84+kleur); + send_position(5+pos); + s2=1; + s3=0; + sendByte(0x84+kleur); + send_position(2+pos); + sendByte(0x84+kleur); + send_position(3+pos); + sendByte(0x84+kleur); + send_position(4+pos); + sendByte(0x84+kleur); + send_position(5+pos); + sendByte(0x84+kleur); + send_position(6+pos); + s3=1; + s4=0; + s5=0; + sendByte(0x84+kleur); + send_position(2+pos); + sendByte(0x84+kleur); + send_position(6+pos); + s4=1; + s5=1; //*********** Einde Letter A ****//// } @@ -1254,7 +1188,7 @@ sendByte(128); latchen(); } - // s1=0; + s1=1; s2=1; s3=1; s4=1; @@ -1269,144 +1203,55 @@ - /* N(0+i,0); - L(0+i,0); - punt(0+i,0); - D(0+i,0); - N(0+i,0); - U(0+i,0); - O(0+i,0); - S(0+i,0); - N(0+i,0); - L(0+i,0);*/ + - - - /* L(0+i-6,0); - N(0+i-13,0); - punt(0+i-17,9); - D(0+i-20,0); - N(0+i-26,14); - U(0+i-32,-3); - O(0+i-38,0x11); - S(0+i-44,0); - N(0+i-50,9); - L(0+i-56,14); - */ - if(i>0){ + if(i>0){ L(0+i-6,0); } if(i>7){ - N(0+i-13,0); + N(0+i-13,0); } if(i>11 ){ - punt(0+i-17,9); + punt(0+i-17,9); } + if(i>14 ){ - D(0+i-20,0); + D(0+i-20,0); } + if(i>20){ - N(0+i-26,14); + N(0+i-26,14); } + if(i>26){ - U(0+i-32,-3); + U(0+i-32,-3); } + if(i>32){ - O(0+i-38,0x11); - } + O(0+i-38,0x11); + } + if(i>38){ - S(0+i-44,0); - } + S(0+i-44,0); + } + if(i>44){ - N(0+i-50,9); - } + N(0+i-50,9); + } + if(i>50){ - L(0+i-56,14); - } + L(0+i-56,14); + } wait_ms(900); - - - - myled=0; - - - - } + + } - /*********************Trial HOI op 1 strip ************************ - - // Trial H - - sendByte(0x84+kleur); // 1 rode led aan - send_position(10); - - - sendByte(0x84+kleur); // 1 rode led aan - send_position(8); - - sendByte(0x84+kleur); // 1 rode led aan - send_position(14+pos); - - sendByte(0x84+kleur); // 1 rode led aan - send_position(15+pos); - - sendByte(0x84+kleur); // 1 rode led aan - send_position(16+pos); - - - sendByte(0x84+kleur); // 1 rode led aan - send_position(36+pos); - - sendByte(0x84+kleur); // 1 rode led aan - send_position(34+pos); - - - - // Trial O - - - sendByte(0x81); // 1 blauwe led aan - send_position(6+pos); - - sendByte(0x81); // 1 blauwe led aan - send_position(5+pos); - - sendByte(0x81); // 1 blauwe led aan - send_position(4+pos); - - sendByte(0x81); // 1 blauwe led aan - send_position(18); - - sendByte(0x81); // 1 blauwe led aan - send_position(32+pos); - - sendByte(0x81); // 1 blauwe led aan - send_position(31); - - sendByte(0x81); // 1 blauwe led aan - send_position(30); - - - sendByte(0x81); // 1 blauwe led aan - send_position(20); - - - // trial I - - - sendByte(0x95+pos); // 1 groene led aan // nu wit gemaakt - send_position(28); - - sendByte(0x95+pos); // 1 groene led aan - send_position(2+pos); - - sendByte(0x95+pos); // 1 groene led aan - send_position(22+pos); - - /************** End HOI ***********/////// - } } \ No newline at end of file + + } + + } \ No newline at end of file