 This is an OLED display very similar to the LCD display we've used on many projects before. The OLED display is just more accurate and it uses a bit of different technology. Personally I think it looks a thousand times better than the LCD display. Here's two pictures up on the screen of what the OLED screen will look like later in this video and then LCD screen that we've used before. So on our OLED screen we have 128 times 64. And while on the LCD screen we also have pixels and we can control those pixels we use this usually as a character display. There are 16 by two characters that you can type in here so we've done like hello world or reviews this as a timer or as a clock before and that's usually the use case for this. With an OLED screen you can go and control the pixels and do whatever you want. You can draw a picture on there, you can draw shapes, you can do animations, things that you can't really do that well on the LCD screen. Also we should note that you can do really small font on here for letters and you can fit a bunch of text and it's also like what a fourth of the size of the LCD display so it allows you to display a bunch more information, animate it, fit it on a smaller platform, use less pins to activate it, less power to activate it and it's about the same price as an LCD display. So personally this one goes to the garbage and this is the one that we use. There are situations where you still use the LCD display and it's still very useful and all that but I'm a real big fan of these because they look so cool. You can even go as far as getting a colored version of this. This one is just white and black and you can invert those colors but you can go and get a colorful version of this and make you know one pixel green, one pixel blue, one pixel yellow, purple, whatever color you'd like and draw some things on the screen. The way it works is it's actually really simple. It has four pins on the top, ground VCC, SCL and SDA. Ground and VCC as every sensor video I've made on this channel ground is to ground, VCC is to power. In this case you could do three volts or five volts. I'm going to be doing five volts in your SCL and SDA. We've done these before on the LCD screen. SCL goes to four analog four and SDA goes to analog five. So my board isn't actually soldered to the cables so I'm just going to stick them through and let it loosely sit on them. Ground VCC, SCL, SDA, ground five volt analog four and analog five. That's the pin out, that's the schematics, that's how you do it. Now once you got your board plugged in to your Arduino through the cables and the pin out that I've showed you, go and open up your Arduino editor and let's go and start writing the code for this module. So here are the three libraries we're going to be including in our project. We can actually go and make this a little bit larger. We have the SBI library, the wire library and Adafruit SSD1306 library. That's because that's what the name of the sensor we're using is called. If you're getting an error when you're trying to couple the code saying these libraries are not included, not found, whatever it is, go into your tools and then to manage libraries, search up SSD1306. So let's go do that quickly and you should see one right over here by Adafruit for this specific module. The first thing you have to do is go and declare a couple different variables. The first thing we're going to do is just copy this. X is going to be your horizontal pixels. So in this case the sensor is 128 times 64. Depending on the type of board you're using you need to declare the reset pin. So for this board it's negative one. If you're using a different board just search up what number port the reset button is plugged into but in this case it's negative one so we're just going to do that and now we can go and actually call this library. You can just copy paste that right here and then you type in display and here we can put in the numbers we just declared. So we have X, Y. The third thing is you're going to have to be including your wire library and before you put the wire library just put this little symbol here that's just pointing a reference to the library instead of actually copying it and putting it a new instance in there and then to go and call your reset. So now we're telling it the board is 128 times 64 you can give it the wire library and then your reset pin which is just R is going to be the number which when this gets activated we're going to be resetting the screen. Now we can go and do whatever you want. So in setup I'm just going to quickly set up my serial dot begin. I'm going to have you guys type this little section out first and then I'll explain exactly what it does so just pause the video take a second. What the section is doing is grabbing the address of your module and then it's checking if it works if it can find it and if it's being able to display anything onto it. If you see this error you might have the wrong address for your module which is this little number here 0x3c. If you are getting this error I'm going to post a file in the description to the github link just take that code we can even do it right here just paste it into your Arduino editor so just upload it to your board and then in your serial monitor you should see a message telling you your address. I see two scanner device found at 0x3c so that is your address that's the one I already have and it works perfectly for me. Then we can just undo all this mess and go back to our original file. Again the code will be in the description for you guys you can just copy paste it run it check what it outputs and then go back to your normal. The first thing you should do is call display dot display and every time you do this every time you call the display method on the display variable you're telling it to kind of print think of it as print so you're giving a printer instructions and then you're clicking the button print you can tell it all right oh we want to print this picture of a dog and then you press the button print that's what display dot display is doing so we call it right away and it's going to run like this add a fruit like display screen just like default logo put a little delay so that it doesn't just run and then get deleted instantly and then under that we can go and clear the display now that we ran that think that think of that as your like initial startup when you're starting your computer you see the windows logo this is like saying the add a fruit logo and now under this we can go and draw whatever we'd like so I'm going to go and just draw a pixel so we're going to go display dot draw pixel and then here we can put the location of the pixel so let's just put it under random location on the screen you also have to go after you give it your x and y coordinates you have to go until it will color to put it in because my screen only has one color which is white or you can invert the screen and it'll make it black you can go and put in white in there and then call your original display dot display with it a little delay let's go through that quickly we're starting the screen and we're printing out the default logo for two seconds then it's going to clear the display and it's going to go and draw a pixel on this coordinates a white pixel it's going to print it out for two seconds and then because we're not clearing the display after it's just going to stay there so let's go quickly and actually upload this to our board now on the camera here I'm going to have to zoom in really close to the sensor just because the pixel gets really really really small seems like we forgot a little semicolon here so let's just add that upload it one more time to the board if you always want to know what your error is it'll show down here again another semicolon the second it's done uploading you should see your screen put that add a fruit display logo and then we could see a little tiny baby pixel over there it kind of looks like a speck of dust some dirt on it let's go back into their Arduino program and grab this drop pixel and just copy paste it a couple times then I'm going to go into my x coordinates and just move each number by one we can go and do it five times so now we have five pixels next to each other I'm just going to go and upload that to the board make sure everything is correct there's no mistakes all right we're good and in a minute or so we'll see that the add a fruit logo will pop up again there we go that's the first display and then we can see that one pixel just became a little line I made this little loop and what it does is it starts at zero zero on the screen and it draws vertically a bunch of dots so it starts at zero zero it goes zero one draws a dot zero two draws a dot zero three draws a dot and then once it hits all the way down to 64 it moves over one and draws an underline so we can go and run this quick and you can actually see it live updating on the little screen this is the idea of how animating works on the screen so you go you make a change you display dot display you make a change you display dot display and then you can see it in real time on the screen so you can't really tell something to move from one place to another and then display does play because it'll just put the final product you have to tell it at each point at each key frame pretty much to go and print and just and update the screen so if you're moving one dot from this block right here onto this block right here you have to move it over display dot display move it over display dot display move it over display dot display you can't move it all the way to the last one tell it move from here to here and then display dot display because it won't show that animation it'll just print it in its final position and now you can see on the screen it's drawing over and over a line and then it's moving over to the next drawing a line moving to the next if i went in the bottom here and commented out this right here when we uploaded that to the Arduino give it a second you'll see the screen uploads so what happened here was it never showed the progress it just waited till it finished all the dots and then it said all right let's print it now the next thing we could do is go and erase this little example right here and we can go and actually add some text onto here let's go on the bottom here and just make a little function so just go void and then inside of this let's go grab display let's go and use little text functions built into the display so we have three of them we have set text size let's go and put that at one we have display set color like i said earlier this is just a mono color screen so we just have white at my capitals and we can go and set the cursor so we're going to tell it to start right in so then we can go and grab the cursor which is just like your mouse on the blocks on the pixels and tell it to start on pixels 00 so it's the top left corner and then on that just like when you print in your console you just want to call inside of that we can just go and put it formatted and then we can grab this function right here call it right here so what's going to happen is it's going to display the default logo two seconds clear the display do our hello world and then display it and there we go we see hello world and it's quite crazy to see the text size difference between this board right here and using the lcd display we can fit so much more information here we can draw shapes and stuff and i could even go in here and change the text size if i'm not happy with that one to a number like two the one problem is if you make the text size too big which two is going to be too big let's wait for it to update quickly you can see that it doesn't actually fit on one lines you can also go and just tell it print line and split up those two words and as you can see now we have hello and world on two separate lines if you wanted more space in between you'd have to either move the cursor and reprint the word or add some kind of empty space in between and it would separate the two more but the fact that you can do whatever you want move it wherever you want you put the world at the bottom left and hello at the top and have a move around it's just crazy comparing to what we started on on this lcd display so as i promised earlier i told you i'd show you what a full animation would look like i didn't write this i'll leave a link to below for the person who did write this on their blog page but what they do is the first thing is they have this line animation then it goes into rectangle then it goes rectangles that are getting filled then it goes into circles then it goes to circles that are getting filled then it goes into round rectangles then it goes filling wreck round rectangles and it goes into triangles then it fills the triangles then it just goes and draws a bunch of letters and characters which is actually a really cool one it draws some different styles and then it does text animation which is what we did earlier this one is personally my favorite because this is what i'll actually be using it for and then it does there we know logo the add a fruit logo has it like fall from the sky this one actually takes forever because the person had to go and physically draw bit by bit what the logo looks like and then now they now that they have that they can go and animate it on the screen that must have taken a really really long time but that's pretty much it we're able to go and turn on individual pixels and doing that you can now and go draw shape link it to a function and then tell that function to go and draw shape or you can make it put text you have infinite options of what you can do here personally what i'm going to be using this for is i'm building currently a security system and this will be the display to see who just put their key card into the security system who just opened the door you can check like the status of the security system is it armed is it disarmed this will be giving you all that information instead of using like three or four of these that are huge and barely fit in any information the cool thing about these little screens is that they're so small and flush that you can probably grab three or four of them and then just line them up and then just tell it to put individual words on individual screens if you enjoyed this video and you enjoyed seeing this little screen animate really cool things please do give it a like and maybe consider subscribing to the channel i have a bunch of cool videos coming out now they're going to be less like this where i'm just putting my hands on the screen and more like my face and me showing you something and taking it and building it and showing you how to solder and doing like more hands-on i think these videos were really helpful but it's time to make more like robot style videos so thanks for being here hope you enjoyed and i'll see you in tomorrow's stream