Home / How To / Arduino Smile MAX7219 Matrix LED Tutorial: 4 steps

Arduino Smile MAX7219 Matrix LED Tutorial: 4 steps



Use the code below to create a smile emoticon in the dot matrix:

# include "LedControl.h"

/ * Now we need a LedControl to work with. ***** These pin numbers probably won't work with your hardware ***** pin 6 is connected to DataIn pin 8 is connected to CLK pin 7 is connected to LOAD We only have a single MAX72XX. * /

LedControl lc = LedControl (6,7,8,1);

unsigned long delay time = 100;

invalid installation () { lc.shutdown (0, false); lc.setIntensity (0.8); lc.clearDisplay (0); }

void smile () { byte a [8] = {B00000000, B01100110, B01100110, B00000000, B00000000, B01000010, B00111100, B00000000};

lc.setRow (0.0, a [0]); lc.setRow (0.1

, and [1]); lc.setRow (0.2, and [2]); lc.setRow (0.3, and [3]); lc.setRow (0.4, and [4]); lc.setRow (0.5, and [5]); lc.setRow (0.6, and [6]); lc.setRow (0.7, and [7]); }

void loop () { smiling(); }


Source link