arduino 8×8 led matrix max7219 code

 


 
These have eight by eight dots, giving us a total of 64 that we can play with and, as you can see, I connected two of them together so I’m, going to go to the connections here and then we’re going to look at the code and we’re going To animate little space invaders on each one of these separately and so very easy to connect, you only need like three pins on your uno to actually make these work, and then you connect them together. So you don’t need more than three to have. I think it’s up to eight, you can have in cascade, so let’s go ahead and see how it’s connected so we’re connecting the five volt to the VCC line on the module the ground goes next and after that you have to reap ends. You have your digital. In your cable select and your clock, so I connected those at 12, 11 and 10 on do you know, and then I just use a jumper cable to go from the end of one to the end of the other one so that’s it that’s all. We need to do here so we’re going to cut we’re going to go to the code. Look at what we’re gon na use to actually drive these guys and then we’ll come back and see the results. I’Ll see you guys soon. Okay, so where we are this, the code we’re going to use right here and first of all, we’re going to include the library called LED control right there.

You can go ahead and go to our website there’s a link to download that library, once you’ve downloaded just go ahead and extract it to our libraries folder right there, so once you’ve done that just close and restart your ID software, so okay, so we’re, including library At the top, then we’re doing LED control which will declare the pins. So we got pin 12 11 and 10 that we’re connected, and the last number is a number of displays. So we have two of them connected, so we put it to here then we’re, going to assign a value of 200 to our delight between frames and then we’re going to put the values in a rate. So these bits – 0 amp 1 – are basically the little invader frames. So the first frame I don’t know if you can see, but if you squint a little bit, the ones actually means that the LED is turned on on the matrix. So that will draw a little invader guy, and the second frame for number 1 is a little bit different, so his legs are moving so that’s the way you actually draw on these little matrix by using zeros and one, and then we do the same thing for Our second invader, so this is the first frame for the second one and the second frame and you could add more frames. If you want or more designs, you just have to declare them in arrays.

Then we do our setup. So LC shut down false because at startup these matrix matrix is are in power, saving mode by default. So so we say false, meaning: wake up so 0, the first one and one, the second one and then the intensity of the LED. So this place 0 is going to be at 5, 1 is going to be at 5, which is about the middle, and then we clear the displays to make sure there is no LED on at startup. So we do. We could have done a for loop here, but we have not enough line to actually do it, but you could do that. So basically that would, if you have a lot of declaration to do, you could do a for loop to actually save some lines. Okay, so now we’re going to declare functions so to put the values of the array on the matrixes so Space Invader, 1, a which is the first frame. So we do a for loop for that until it reaches 8 because it has 8 lines. So we say: okay display 0, the invader 1a, the array, so that will put the first line of our little bit map on that and we do the same thing for each each one of them. So one B, which is the second frame we will draw that with that function and then this one for the second invader, guy first frame the same thing second frame, so you could add or modify that as you want to have more frames in your animation, then We do our main loop, so we’re calling our functions, so we put the number one frame on both display for each invader, so we call the function 1a up here.

That will draw the first frame on the first display and then we do the second for the second display and we put the delay time between drawing the frames. And then we do the same thing for the second frame. So we draw the second frame on both displays and then it loops around like that. So we’re going to verify our code, make sure there’s no errors, and that seems to be okay, so we’re going to upload the code. So now we’re going to go back to our breadboard and see what happens: okay, so we’re back to our little setup. Here we uploaded the code to our own out and I’m going to plug it in then we should start seeing our little guys appearing on each one of these module. So let’s go ahead and there you go I’m going to dim the light. So we can see it better. There you go so the way it works basically, is that it writes one frame here, one frame there and then writes the second frame here second frame there, but it does it so fast that it’s, like they’re being animated. At the same time, so there you go that’s kind of fun, you could. The you know play with the bit mats: do your own make a little mario guy or you could do letters and you can scroll them so with the code we just used just go ahead and modify play around with it and make your own things.

So, thanks again for watching my name is Ivan. If you’re watching on YouTube, please subscribe to our Channel we’re, putting out the tutorials every week and also check out our tutorial page on brainy viscom to have the schematics and download the codes and a library that we use for this project.

 
 

arduino 8×8 led matrix max7219 code Video

 

 

 

 

 

 

arduino 8×8 led matrix max7219 code news

 

 

 

 

 

 

 

arduino 8×8 led matrix max7219 code Social

 

 

 

 

official.arduino
2019-10-02T19:32:52+0000

👋 Want to bring Tony Stark-like gesture control to your projects? Learn how with the BLE-enabled MKR WiFi 1010 and Nano 33 BLE Sense boards using the ArduinoBLE library.
safe image.php?d=AQDyi1ELcW4VGzhx&w=720&h=720&url=https%3A%2F%2Fhackster.imgix.net%2Fuploads%2Fattachments%2F997327%2Fblob dChOhNMmeF - arduino 8x8 led matrix max7219 code
official.arduino
2019-10-02T19:08:01+0000

Arduin-yo ho ho! A fairground favorite, the pirate ship is a fun way to explore the oscillation of a pendulum. How much fun, you ask? Access our Science Kit Physics Lab preview and see for yourself: http://bit.ly/2oC6L0Q

🔬 Now that you’ve gotten your feet wet, dive into the kit and enjoy all nine experiments. Order yours today: http://bit.ly/2MnQ7fr

70537898 550174072395145 8798850142103928832 n.jpg? nc cat=102& nc oc=AQmCfMPwMf1oPpYqFhzbxfnGdbrmsjZXrEEBy1ox5Z8EJtiYMADoFNZ5mnSNRgCCY74& nc ht=scontent - arduino 8x8 led matrix max7219 code



 photo

2016-04-15T14:35:45



 photo

2016-04-15T14:35:40



 photo

2016-04-15T14:35:36



 photo

 

 

(Visited 16 times, 1 visits today)

About The Author

You might be interested in

Comment (33)

  1. hey my friend i need your help, i do exactly all you did, but in my matrix all the leds start ON and i can’t turn them OFF. please help!

    1. +Michelle Perez Morales Hard to say, but check all connections to make sure the module connections are all good and making contact. Thanks for watching!

  2. Thanks Ivan. great project & tutorial easy to understand. Can you please give some tips on making a digital clock with these modules ? a clock that every 10 seconds, the numbers scramble, collapse, shatter. or rainfall to form the new time reading. I saw it on a gadget shop but was pricey..trying to DIY if you can help.

    1. It’s been a while since this video, but I believe the max number you can link together is 8x. Thanks for watching btw 🙂

    2. Thanks, I was trying with 10 and it was working but whe i put another one, It doesnt work… (sorry for my english)

  3. Is there any way to program the Arduino in compiled Python, and not C? I don’t want to touch C with a ten foot pole. C is some rancid low level garbage… its only one step up from programming in assembly…

    1. What is hard about a HANDLE, it’s just an INT, buffers are up to you to program correctly. Indirection (pointers to you) is a very powerful tool when used correctly, and if code is indented correctly,it is perfectly readable. It also trains you to be structured in your thinking and coding, which leads to better products.

    2. +Ian Turner How about a variable that actually contains the data it is suppose to contain, no a variable that points to another variable that just points to where the actual data is somewhere in memory. What kind of fucked up mess is that. No, C needs to go the way of Cobol and Forth and Lisp, it’s over stayed it’s welcome…

    3. Pointers allow you to manipulate data very processor efficiently for a start, but of course, if you can’t handle it……….. Take the baby route instead 🙂

    4. If you’re programming an arduino, you’re basically programming in a higher level language since the arduino bootloader deals with and gives you access to a lot of premade functions. Also, the arduino already has a bad enough time with memory and program size, you don’t want to make that even worse by trying to run a high level scripting language on it. There’s a reason embedded microcontrollers are often only given a c compiler and an assemblr

  4. Would it be possible to run two 8×8 LED matrices off one max7219 chip, I would like them to display the same image, but am trying to save space. Thanks!!

  5. What can I do to use two matrices, but have the same image on each. I used the same bitmap ‘image’ for each matrix, but they have a delay between each as they switch images. Is there any way to have both give the same image without he delay between the two?

  6. hi, what if we removed the 8×8 display from the max7219 driver board. can the board then be used to drive 8 digits of 7 segments display?

  7. Covering the leds with red tape or some kind of cover (preferably not black) will make them show up more clear on camera..
    Otherwise, nice presented..
    Regards!

    1. Thanks for the led camera trick I’ll keep that in mind next time I do a video that uses leds. Thanks for watching btw!

LEAVE YOUR COMMENT

Your email address will not be published. Required fields are marked *