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
Posted on Wednesday July 04, 2012Arduino and LEDs Help You Give Everyone the Look of Disapproval PCWorld … Continue Reading »
Posted on Tuesday January 15, 2019Arduino Hunts (and Sees) The Wumpus Hackaday … Continue Reading »
Posted on Thursday June 27, 2019Scripting Language Rapidly Develops A Clock Hackaday … Continue Reading »
arduino 8×8 led matrix max7219 code Social
🔬 Now that you’ve gotten your feet wet, dive into the kit and enjoy all nine experiments. Order yours today: http://bit.ly/2MnQ7fr
Originally posted 2016-04-09 01:49:16.