webwinkelkeur logo

4.7 avg.

5158+ reviews
webwinkelkeur logoView all

5158+ reviews

5158+ reviews

Order by 16:00 for same day shipping

14 days return

GB

EN

Individual

Business

Arduino Project: LED light box

Intermediate
60 Min
36,85

Once your Pi is connected you can boot it up. You should now get the screen below. In this project you will learn how to make your own LED newspaper.

We do this with a 32X8 LED matrix and an Arduino UNO. The code that comes with this project is long. This is because you have to make every letter, number and such yourself on a 7X8 grid. The reason that it is 7 by 8 is because we only use 7 of the 8 rows vertically to make the characters. The way we make the characters means that we have seven rows of eight long. Each row consists of ones and zeros, 1 means that the light is on and 0 that it is off.

Building and Wiring

Now that you have all the parts you can start wiring. First you go with a cable from the CLK to I/O pin 13, from CS to I/O pin 10, from DIN to I/O pin 11, from GND to the GND on the Arduino and from the VCC to the 5V on the Arduino.

Programming

Now that you have connected everything you can start programming.

For programming it is important that you have the ledcontrol library. You need this to control the modules on the matrices. You can find this library in the Arduino IDE if you go to manage libraries and when you are there type LedControl in the search bar.

It is a long code but it is almost only drawing figures. The reason is that a figure uses seven lines under each other you can also do it in one. But this way it is easier to make a figure because you are already partly visualizing it. So you already know partly how it will look.

If you put the program on the Arduino as it is now you will see the text electronics for you. You can change this to show a text of your choice.

#include <LedControl.h>  

 

//zorgt dat de LED lampjes alleen aangaan wanneer nodig

//als de waarde onder 14 is wordt het steeds moeilijker om te lezen wat er staat

unsigned long BL [14] = {0}; 

//zorgt dat de pinnen en hoeveelheid beeldschermen duidelijk is

LedControl lc=LedControl(11,13,10,4);

//hier zet je de text neer die je wilt laten zien

const unsigned char scrollText[] PROGMEM ={” elektronica voor jou       “};

 

void setup()

{

  //hier worden de beeldschermen gekalibreerd

  for (int x=0; x<4; x++)

  {

    lc.shutdown(x,false);      

    lc.setIntensity(x,8);      

    lc.clearDisplay(x);        

  }

}

 

//hier zorgen we dat de text beweegt

void loop(){

    scrollMessage(scrollText);      

}

 

//hier tekenen we iedere letter, cijfer en dergelijke

const unsigned char font5x7 [] PROGMEM = {    

    B00000000,  //Spatie

    B00000000,

    B00000000,

    B00000000,

    B00000000,

    B00000000,

    B00000000,

    3,

 

    B01000000,  //!

    B01000000,

    B01000000,

    B01000000,

    B01000000,

    B00000000,

    B01000000,

    2,

 

    B10100000,  //”

    B10100000,

    B10100000,

    B00000000,

    B00000000,

    B00000000,

    B00000000,

    4,

 

    B01010000,  //#

    B01010000,

    B11111000,

    B01010000,

    B11111000,

    B01010000,

    B01010000,

    6,

 

    B00100000,  //$

    B01111000,

    B10100000,

    B01110000,

    B00101000,

    B11110000,

    B00100000,

    6,

 

    B11000000,  //%

    B11001000,

    B00010000,

    B00100000,

    B01000000,

    B10011000,

    B00011000,

    6,

 

    B01100000,  //&

    B10010000,

    B10100000,

    B01000000,

    B10101000,

    B10010000,

    B01101000,

    6,

 

    B11000000,  //’

    B01000000,

    B10000000,

    B00000000,

    B00000000,

    B00000000,

    B00000000,

    3,

 

    B00100000,  //(

    B01000000,

    B10000000,

    B10000000,

    B10000000,

    B01000000,

    B00100000,

    4,

 

    B10000000,  //)

    B01000000,

    B00100000,

    B00100000,

    B00100000,

    B01000000,

    B10000000,

    4,

 

    B00000000,  //*

    B00100000,

    B10101000,

    B01110000,

    B10101000,

    B00100000,

    B00000000,

    6,

 

    B00000000,  //+

    B00100000,

    B00100000,

    B11111000,

    B00100000,

    B00100000,

    B00000000,

    6,

 

    B00000000,  //,

    B00000000,

    B00000000,

    B00000000,

    B11000000,

    B01000000,

    B10000000,

    3,

 

    B00000000,  //-

    B00000000,

    B11111000,

    B00000000,

    B00000000,

    B00000000,

    B00000000,

    6,

 

    B00000000,  //.

    B00000000,

    B00000000,

    B00000000,

    B00000000,

    B11000000,

    B11000000,

    3,

 

    B00000000,  ///

    B00001000,

    B00010000,

    B00100000,

    B01000000,

    B10000000,

    B00000000,

    6,

 

    B01110000,  //0

    B10001000,

    B10011000,

    B10101000,

    B11001000,

    B10001000,

    B01110000,

    6,

 

    B01000000,  //1

    B11000000,

    B01000000,

    B01000000,

    B01000000,

    B01000000,

    B11100000,

    4,

 

    B01110000,  //2

    B10001000,

    B00001000,

    B00010000,

    B00100000,

    B01000000,

    B11111000,

    6,

 

    B11111000,  //3

    B00010000,

    B00100000,

    B00010000,

    B00001000,

    B10001000,

    B01110000,

    6,

 

    B00010000,  //4

    B00110000,

    B01010000,

    B10010000,

    B11111000,

    B00010000,

    B00010000,

    6,

 

    B11111000,  //5

    B10000000,

    B11110000,

    B00001000,

 

    B00001000,

    B10001000,

    B01110000,

    6,

 

    B00110000,  //6

    B01000000,

    B10000000,

    B11110000,

    B10001000,

    B10001000,

    B01110000,

    6,

 

    B11111000,  //7

    B10001000,

    B00001000,

    B00010000,

    B00100000,

    B00100000,

    B00100000,

    6,

 

    B01110000,  //8

    B10001000,

    B10001000,

    B01110000,

    B10001000,

    B10001000,

    B01110000,

    6,

 

    B01110000,  //9

    B10001000,

    B10001000,

    B01111000,

    B00001000,

    B00010000,

    B01100000,

    6,

 

    B00000000,  //:

    B11000000,

    B11000000,

    B00000000,

    B11000000,

    B11000000,

    B00000000,

    3,

 

    B00000000,  //;

    B11000000,

    B11000000,

    B00000000,

    B11000000,

    B01000000,

    B10000000,

    3,

 

    B00010000,  //<

    B00100000,

    B01000000,

    B10000000,

    B01000000,

    B00100000,

    B00010000,

    5,

 

    B00000000,  //=

    B00000000,

    B11111000,

    B00000000,

    B11111000,

    B00000000,

    B00000000,

    6,

 

    B10000000,  //>

    B01000000,

    B00100000,

    B00010000,

    B00100000,

    B01000000,

    B10000000,

    5,

 

    B01110000,  //?

    B10001000,

    B00001000,

    B00010000,

    B00100000,

    B00000000,

    B00100000,

    6,

 

    B01110000,  //@

    B10001000,

    B00001000,

    B01101000,

    B10101000,

    B10101000,

    B01110000,

    6,

 

    B01110000,  //A

    B10001000,

    B10001000,

    B10001000,

    B11111000,

    B10001000,

    B10001000,

    6,

 

    B11110000,  //B

    B10001000,

    B10001000,

    B11110000,

    B10001000,

    B10001000,

    B11110000,

    6,

 

    B01110000,  //C

    B10001000,

    B10000000,

    B10000000,

    B10000000,

    B10001000,

    B01110000,

    6,

 

    B11100000,  //D

    B10010000,

    B10001000,

    B10001000,

    B10001000,

    B10010000,

    B11100000,

    6,

 

    B11111000,  //E

    B10000000,

    B10000000,

    B11110000,

    B10000000,

    B10000000,

    B11111000,

    6,

 

    B11111000,  //F

    B10000000,

    B10000000,

    B11110000,

    B10000000,

    B10000000,

    B10000000,

    6,

 

    B01110000,  //G

    B10001000,

    B10000000,

    B10111000,

    B10001000,

    B10001000,

    B01111000,

    6,

 

    B10001000,  //H

    B10001000,

    B10001000,

    B11111000,

    B10001000,

    B10001000,

    B10001000,

    6,

 

    B11100000,  //I

    B01000000,

    B01000000,

    B01000000,

    B01000000,

    B01000000,

    B11100000,

    4,

 

    B00111000,  //J

    B00010000,

    B00010000,

    B00010000,

    B00010000,

    B10010000,

    B01100000,

    6,

 

    B10001000,  //K

    B10010000,

    B10100000,

    B11000000,

    B10100000,

    B10010000,

    B10001000,

    6,

 

    B10000000,  //L

    B10000000,

    B10000000,

    B10000000,

    B10000000,

    B10000000,

    B11111000,

    6,

 

    B10001000,  //M

    B11011000,

    B10101000,

    B10101000,

    B10001000,

    B10001000,

    B10001000,

    6,

 

    B10001000,  //N

    B10001000,

    B11001000,

    B10101000,

    B10011000,

    B10001000,

    B10001000,

    6,

 

    B01110000,  //O

    B10001000,

    B10001000,

    B10001000,

    B10001000,

    B10001000,

    B01110000,

    6,

 

    B11110000,  //P

    B10001000,

    B10001000,

    B11110000,

    B10000000,

    B10000000,

    B10000000,

    6,

 

    B01110000,  //Q

    B10001000,

    B10001000,

    B10001000,

    B10101000,

    B10010000,

    B01101000,

    6,

 

    B11110000,  //R

    B10001000,

    B10001000,

    B11110000,

    B10100000,

    B10010000,

    B10001000,

    6,

 

    B01111000,  //S

    B10000000,

    B10000000,

    B01110000,

    B00001000,

    B00001000,

    B11110000,

    6,

 

    B11111000,  //T

    B00100000,

    B00100000,

    B00100000,

    B00100000,

    B00100000,

    B00100000,

    6,

 

    B10001000,  //U

    B10001000,

    B10001000,

    B10001000,

    B10001000,

    B10001000,

    B01110000,

    6,

 

    B10001000,  //V

    B10001000,

    B10001000,

    B10001000,

    B10001000,

    B01010000,

    B00100000,

    6,

 

    B10001000,  //W

    B10001000,

    B10001000,

    B10101000,

    B10101000,

    B10101000,

    B01010000,

    6,

 

    B10001000,  //X

    B10001000,

    B01010000,

    B00100000,

    B01010000,

    B10001000,

    B10001000,

    6,

 

    B10001000,  //Y

    B10001000,

    B10001000,

    B01010000,

    B00100000,

    B00100000,

    B00100000,

    6,

 

    B11111000,  //Z

    B00001000,

    B00010000,

    B00100000,

    B01000000,

    B10000000,

    B11111000,

    6,

 

    B11100000,  //[

    B10000000,

    B10000000,

    B10000000,

    B10000000,

    B10000000,

    B11100000,

    4,

 

    B00000000,  //(\)

    B10000000,

    B01000000,

    B00100000,

    B00010000,

    B00001000,

    B00000000,

    6,

 

    B11100000,  //]

    B00100000,

    B00100000,

    B00100000,

    B00100000,

    B00100000,

    B11100000,

    4,

 

    B00100000,  //^

    B01010000,

    B10001000,

    B00000000,

    B00000000,

    B00000000,

    B00000000,

    6,

 

    B00000000,  //_

    B00000000,

    B00000000,

    B00000000,

    B00000000,

    B00000000,

    B11111000,

    6,

 

    B10000000,  //`

    B01000000,

    B00100000,

    B00000000,

    B00000000,

    B00000000,

    B00000000,

    4,

 

    B00000000,  //a

    B00000000,

    B01110000,

    B00001000,

    B01111000,

    B10001000,

    B01111000,

    6,

 

    B10000000,  //b

    B10000000,

    B10110000,

    B11001000,

    B10001000,

    B10001000,

    B11110000,

    6,

 

    B00000000,  //c

    B00000000,

    B01110000,

    B10001000,

    B10000000,

    B10001000,

    B01110000,

    6,

 

    B00001000,  //d

    B00001000,

    B01101000,

    B10011000,

    B10001000,

    B10001000,

    B01111000,

    6,

 

    B00000000,  //e

    B00000000,

    B01110000,

    B10001000,

    B11111000,

    B10000000,

    B01110000,

    6,

 

    B00110000,  //f

    B01001000,

    B01000000,

    B11100000,

    B01000000,

    B01000000,

    B01000000,

    6,

 

    B00000000,  //g

    B01111000,

    B10001000,

    B10001000,

    B01111000,

    B00001000,

    B01110000,

    6,

 

    B10000000,  //h

    B10000000,

    B10110000,

    B11001000,

    B10001000,

    B10001000,

    B10001000,

    6,

 

    B01000000,  //i

    B00000000,

    B11000000,

    B01000000,

    B01000000,

    B01000000,

    B11100000,

    4,

 

    B00010000,  //j

    B00000000,

    B00110000,

    B00010000,

    B00010000,

    B10010000,

    B01100000,

    5,

 

    B10000000,  //k

    B10000000,

    B10010000,

    B10100000,

    B11000000,

    B10100000,

    B10010000,

    5,

 

    B11000000,  //l

    B01000000,

    B01000000,

    B01000000,

    B01000000,

    B01000000,

    B11100000,

    4,

 

    B00000000,  //m

    B00000000,

    B11010000,

    B10101000,

    B10101000,

    B10001000,

    B10001000,

    6,

 

    B00000000,  //n

    B00000000,

    B10110000,

    B11001000,

    B10001000,

    B10001000,

    B10001000,

    6,

 

    B00000000,  //o

    B00000000,

    B01110000,

    B10001000,

    B10001000,

    B10001000,

    B01110000,

    6,

 

    B00000000,  //p

    B00000000,

    B11110000,

    B10001000,

    B11110000,

    B10000000,

    B10000000,

    6,

 

    B00000000,  //q

    B00000000,

    B01101000,

    B10011000,

    B01111000,

    B00001000,

    B00001000,

    6,

 

    B00000000,  //r

    B00000000,

    B10110000,

    B11001000,

    B10000000,

    B10000000,

    B10000000,

    6,

 

    B00000000,  //s

    B00000000,

    B01110000,

    B10000000,

    B01110000,

    B00001000,

    B11110000,

    6,

 

    B01000000,  //t

    B01000000,

    B11100000,

    B01000000,

    B01000000,

    B01001000,

    B00110000,

    6,

 

    B00000000,  //u

    B00000000,

    B10001000,

    B10001000,

    B10001000,

    B10011000,

    B01101000,

    6,

 

    B00000000,  //v

    B00000000,

    B10001000,

    B10001000,

    B10001000,

    B01010000,

    B00100000,

    6,

 

    B00000000,  //w

    B00000000,

    B10001000,

    B10101000,

    B10101000,

    B10101000,

    B01010000,

    6,

 

    B00000000,  //x

    B00000000,

    B10001000,

    B01010000,

    B00100000,

    B01010000,

    B10001000,

    6,

 

    B00000000,  //y

    B00000000,

    B10001000,

    B10001000,

    B01111000,

    B00001000,

    B01110000,

    6,

 

    B00000000,  //z

    B00000000,

    B11111000,

    B00010000,

    B00100000,

    B01000000,

    B11111000,

    6,

};

 

//hier zorgen we dat er verticaal 7 LED

//lampjes aan gaan

void rotate(){

    for (int a = 0; a < 7; a++){                   

        unsigned long x = BL [a*2];   

        byte b = bitRead(x,31);               

        x = x<<1;                             

        BL [a*2] = x;                

        x = BL [a*2+1];              

        x = x<<1;                              

        bitWrite(x,0,b);                      

        BL [a*2+1] = x;                

    }

} 

 

//hier zorgen wij dat iedere letter, cijfer en degelijke

//beschikbaar is om te gebruiken

void load(int ascii){

    if (ascii >= 0x20 && ascii <= 0x7f){

        for (int a = 0; a < 7; a++){                    

            unsigned long c = pgm_read_byte_near(font5x7 + ((ascii – 0x20) * 8) + a);   

            unsigned long x = BL [a*2];    

            x = x | c;                              

            BL [a*2] = x;                 

        }

        byte count = pgm_read_byte_near(font5x7 +((ascii – 0x20) * 8) + 7);   

        for (byte x = 0; x < count; x++){

            rotate();

            print();

            delay(10);

        }

    }

}

 

//hier zorgen we dat de tekst de juiste matrixen volgt

void print(){

  for (int a = 0; a < 7; a++){                   

    unsigned long x = BL [a*2+1]; 

    byte y = x;                            

    lc.setRow(3,a,y);                      

    x = BL [a*2];                  

    y = (x>>24);                           

    lc.setRow(2,a,y);                     

    y = (x>>16);                           

    lc.setRow(1,a,y);                     

    y = (x>>8);                            

    lc.setRow(0,a,y);                     

  }

}

 

//hier zorgen wij dat de tekst van

//rechts naar links beweegt

void scrollMessage(const unsigned char * messageString) {

    int counter = 0;

    int myChar=0;

    do {

 

        myChar =  pgm_read_byte_near(messageString + counter);

        if (myChar != 0){

            load(myChar);

        }

        counter++;   

    }

    while (myChar != 0);

}