├── LedControlMS.cpp ├── LedControlMS.h ├── README.md ├── arduino_led_matrix_sketch.ino └── keywords.txt /LedControlMS.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaai/Arduino_LED_matrix_sketch/6a8a06280f25c443acbbf8ffeb6cf38e5ff614c8/LedControlMS.cpp -------------------------------------------------------------------------------- /LedControlMS.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaai/Arduino_LED_matrix_sketch/6a8a06280f25c443acbbf8ffeb6cf38e5ff614c8/LedControlMS.h -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Arduino Text Writing Sketch 2 | ============================ 3 | An arduino sketch that sends a looping message to a MAX7219 LED Matrix display module. Because of the high speed at which the message prints to the matrix, it can be used as a tool for writing messages in long exposure photography. 4 | 5 | 6 | ##Setting Up the Arduino and MAX7219 Matrix 7 | 8 | ###Components you'll need: 9 | * Arduino Uno board 10 | * 5 jumper wires (female/male) 11 | * MAX7219 Red Dot Matrix Display Module 12 | * Arduino USB cable 13 | 14 | ![Alt text](https://cloud.githubusercontent.com/assets/6833837/5483412/634e4080-863f-11e4-860d-e28800a4d49c.jpg) 15 | 16 | 17 | ###Connecting the Components 18 | 19 | 1. LED matrix connections to arduino: 20 | * VCC to 5V 21 | * GND to GND 22 | * DIN to Digital 2 23 | * CS to Digital 4 24 | * CLK to Digital 3 25 | 26 | 2. Connect the USB cable from the arduino to your computer. 27 | 28 | ![Alt text](https://cloud.githubusercontent.com/assets/6833837/5483413/6be773ec-863f-11e4-8484-44e0983e2c5b.jpg) 29 | 30 | 31 | ###Setting up the Arduino Sketch 32 | 33 | 1. Download the Arduino software if you have not already: http://arduino.cc/en/Main/Software 34 | 35 | 2. Download and uncompress a ZIP file of this repo. 36 | 37 | 3. Look for the **libraries** folder inside the folder where you installed the Arduino software. Make sure you close all the open windows of Arduino IDE when you do this. 38 | 39 | 4. Copy the uncompressed repo folder, delete the README.md file within, and place it inside the libraries folder. 40 | 41 | 5. Open the Arduino software again. Go to **File > Examples > Arduino_LED_matrix_sketch** 42 | 43 | 6. Under the **Tools** menu make sure the correct Board and Serial Port are selected. 44 | 45 | 7. Verify and upload the sketch to your arduino to see the text print to your LED Matrix! 46 | 47 | 8. Experiment with long exposure photography by moving the matrix to write messages in your photos. 48 | 49 | ![Alt text](https://cloud.githubusercontent.com/assets/6833837/5499733/7787bb3e-8703-11e4-84d6-2399907882c9.jpg) 50 | -------------------------------------------------------------------------------- /arduino_led_matrix_sketch.ino: -------------------------------------------------------------------------------- 1 | //include the library 2 | #include "LedControlMS.h" 3 | 4 | /* 5 | Configuring the LEDMatrix: 6 | Digital 2 is conneted to DIN (Data IN) 7 | Digital 3 is connected to CLK (CLocK) 8 | Digital 4 is connected to CS (LOAD) 9 | 5V is connected to VCC 10 | GND is connected to GND 11 | There is only one MAX7219 display module. 12 | */ 13 | 14 | #define NBR_MTX 2 15 | LedControl lc=LedControl(2,3,4, NBR_MTX); 16 | //LedControl lc=LedControl(2,3,4, NBR_MTX); 17 | 18 | String sentence= "WDI WHAATTT "; 19 | int letterCounter=0; 20 | /* wait time between updates of the display */ 21 | unsigned long delaytime=300; 22 | 23 | void setup() { // initalizes and sets up the initial values. Declaring function setup. 24 | /* The display module is in power-saving mode on startup. 25 | Do a wakeup call */ 26 | Serial.begin(9600); // setting data rate as 9600 bits per second for serial data communication to computer 27 | Serial.println("Setup"); //prints data to serial port as human-readable text 28 | letterCounter=0; 29 | for (int i=0; i< NBR_MTX; i++){ 30 | lc.shutdown(i,false); //keep the screen on 31 | lc.setIntensity(i,8); // set brightness to medium values 32 | lc.clearDisplay(i); //clear the display after each letter 33 | } 34 | } 35 | 36 | void loop() { //declaring function loop 37 | char ch= sentence[letterCounter]; //define character ch 38 | letterCounter++; 39 | if (letterCounter>14) letterCounter=0; //sets up loop 40 | lc.displayChar(0, lc.getCharArrayPosition(ch)); //display each character on the screen 41 | delay(2); 42 | lc.clearAll(); 43 | delay(2); 44 | } 45 | -------------------------------------------------------------------------------- /keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For LedControl 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | LedControl KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | 15 | shutdown KEYWORD2 16 | setScanLimit KEYWORD2 17 | setIntensity KEYWORD2 18 | clearDisplay KEYWORD2 19 | setLed KEYWORD2 20 | setRow KEYWORD2 21 | setColumn KEYWORD2 22 | setDigit KEYWORD2 23 | setChar KEYWORD2 24 | 25 | ####################################### 26 | # Constants (LITERAL1) 27 | ####################################### 28 | 29 | --------------------------------------------------------------------------------