Hello everyone. We are on another bonus lecture and today we are going to do a lecture about the Arduino. Now there's two kinds of people. Either you know what an art wino is or you don't know what an Arduino is and you may have even heard of it but haven't played with it. So this is the first try and explain what this is. A lot of people use the name Arduino to refer to both hardware and software and also even a philosophy. So let's kind of clear that up first. So that we're all on the same page a few years ago. I don't know maybe we'd have to google it but maybe 10 years ago a couple of guys from Italy came up with this small little board with a microcontroller on it. And as a matter of fact we could say Arduino origins or history and you could take a look at this also right here. So anyway you can read through this but the whole idea was a couple of guys from Italy and let's see here. 2003 roughly. And I'm not sure if that's exact date that it started but it was a while ago. Anyway they came up with this kind of project and the whole idea of the project was to put a microcontroller on it and then make it really easy to experiment write code and just play with a microcontroller. Now the problem with microcontrollers is if you haven't played with one many of them are fairly complicated. And let me just go back here. We'll just leave it here for loop this on what we know. So a microcontroller is a small computer right. It's similar to a microprocessor except a micro microcontroller has both the processing core and it has all the peripherals and it has the memory built in. So basically it's an entire computer on a chip. That's what a microcontroller is and a microcontrollers have been around for a long long time. Maybe I'd say probably almost 30 years definitely 20 years. In any event. You know before when you would build a computer say it say like in the 70s 80s you would use maybe 80 a 60 5:0 to a little bit later you might use a 60000 processor. Those were all processors and to build a computer out of them you had to add a ROM or maybe an easy problem for your program and then maybe some ram some peripheral chips you input output and things of that nature to build a computer around it and the processor just did that it just did processing so just executed instructions and it needed support chips to operate over time as our ability to add more and more chips on on the same dive. I see we took all those extraneous extra peripherals NICS and memory and so forth and just put them on a single chip. And now there are literally thousands of microcontrollers and there are probably hundreds of vendors or probably tens of thousands of microcontrollers and hundreds of vendors that manufacture microcontrollers. Some of the companies are microchip that make the PIC processors a line of very small 8 and 16 bit microcontrollers that go from you know pennies in high quantities to you know a few dollars. Very powerful actually. There's Atmel which microchip actually bought and Atmel makes the of our processors. They also licensed arm and arm. You can get our microcontroller So you think when you think of army you might think of processors microprocessors but arm also makes microcontroller cores. So there is a whole arm series of microcontrollers the cortex line for example. Then there's Freescale and XP there are just countless companies that make microcontrollers in why we like microcontrollers is that they're very easy to work with in as much as electrically we don't have to design that much around them. You basically put the microcontroller on a circuit board you add power to it maybe some clocking some startup circuitry or reset circuit a couple of things and then basically you've got an entire computer and most microcontroller has had GPI those general purpose Io's which then can be used for input or output to drive things turn things on control things read things and then they have an array of roles like serial ports spy port serial peripheral interface. I square it see which is another serial protocol they have can control area network for cars ether net wireless modules built in anything you want is in a microcontroller now so they're very very powerful and microcontrollers are as powerful as big processors are. So like I said there are arm microcontrollers as well. And in the arm line of microcontrollers there's the 0 and 1 and 3 and 4 and 7 processors or microcontrollers and these are very powerful you know much much more powerful than say a Pentium computer used to be or even a Pentium to maybe even a Pentium 3 and probably a Pentium 3. The cortex 7 is a faster more powerful. So but even still electrically they're easier to work with microcontrollers. The problem is is that programming them is not easy. Usually you still have to know quite a bit about embedded engineering. And so each one of the manufacturers whether it's a microchip or whether it's at Malheur and XP or Renaissance or Freescale you name it. A lot of them will build their own tool usually typically an assembly language tool or a C C++ tool and I.T. and then you can develop for their line of microcontrollers write your code use maybe some of their libraries compile it download the code to the microcontroller which is usually over a serial interface or a J tag interface and Jay Tygers a special programming interface and debugging interface with just a few tens and this whole process is still not easy. So even with the tool from the manufacturer that they've either developed or co-developed with a third party company it's still not easy so embedded engineers whenever they want to build something with a microcontroller typically they have to you know evaluate different microcontrollers look at their memory their performance their costs all these kind of things. Then they have to learn the tool many times from the manufacturer or get a third party tool that maybe supports that microcontroller but that's only if that microcontroller is very popular. All right. So all of that just makes it really hard for just kind of an everyday person that wants to play with electronics maybe play with these cool things microcontrollers to even know where to begin. Even engineers with degrees and that have played with microprocessors in the past trying to get a microcontroller up and running with a certain tool and so forth is not easy. All right. Therefore these guys these couple of Italian guys and other people have done this right. Other people have made this simplify this. I have another company has a parallax has and lots of people have made products and some of them just get more popular than others anyway. Couple of guys you know over 10 years ago came up and said hey let's take a little ape that processor. Not very powerful. And this is the A-team and I believe at the time it was the 0 1 6 8 processor. So it literally had a flash memory and maybe I think one k of RAM we can look it up. Anyway it's just an 8 bit processor from Atmel Corp called the AVR which stands for something I can't remember anyway and they developed this very simple board that just literally had the microcontroller on it power and then a way to interface to it so you could program it right over a V port and over a serial connection and then the biggest problem again. So the hardware wasn't that complicated but the biggest problem is the software like how do you code this thing. Right. So getting C compilers up and running is fairly complicated. So what they did was is that they used kind of a kind of a version of upsy and now really a version of just a set of libraries a set of headers a philosophy called processing and this is a kind of a language and it uses C and the whole idea is it's it's designed so that you kind of communicate to a piece of hardware with very simple functions. And so even though you're coding in C it's you kind of using a library and using certain functionalities to make it easy to program. All right so now that's great. But how do we get this tool to work on all these different computers. So then what they did was they said all right Java works on everything right now so why don't we do this we'll take all the complicated compiler tools which is the GCC the good new compilers are the good new foundation if you ever heard of that it's a set of free tools all kinds of technology and one of those tools is the gcc compiler which is actually an acronym of of itself. It's a new new compiler something which is the new compiler or something. Anyway so Ganu makes a thing called gcc which is a compiler and the compiler tools work on many many microcontrollers and microprocessors so they have a version or a core piece of software for many many many different targets. All right one of those targets is the bar. All right. So the two guys the Italian guy said All right let's let's make a Java tool that is super simple not really complicated. All right and if you're obviously if you're a programmer you use visual visual C++ big tools like that or maybe you use X code and you know these tools are massive Right. But when you're learning a program they're really overwhelming that just 10000 menus and settings and you don't know even where to begin. So they said people cannot know anything about this. We just want something that's like a text editor and you literally press a couple buttons and it will work and it'll work no matter if you're on a Mac or Linux or a PC. All right so that's a challenge. So here's the deal we have to have this Java tool which will work on all these computers and always have the same look and feel under under that hidden is that the new compiler gcc is running and they've set it all up to run and actually take your C code that you're going to write inside of the editor compile it linkit build a binary have some piece of software they can download it to this little board wretch's you know shown as little picture right here. And then do whatever it is you told it to do. All right. So that is what Arduino is so Arduino is. Initially it was a very specific board for the Arduino Uno which had the Atmel AVR chip on there the 168 and they all have Italian names so it's kind of hard to keep track of all this stuff. But anyway and then after they came out with kind of another version another version was kind of upgrading it. And then it kind of exploded and everybody got into it. And now there are Arduino pieces of hardware that are based on many many different kinds of microcontrollers. But the philosophy is the tool that they made you can still use it to build a program for any of these wino's and the libraries all have layers of interface so if you say like you want to write a pen or read a pen it's always right pen and. So it's always the same. And then there's a layer of software that interfaces to the lower functions of the API of that particular microcontroller whether it's an arm controller or an arm or a picker or this or that Loki's work. So the point is Arduino is not just the board. Arduino is not just a piece of software. Arduino is an entire philosophy where they're like we're going to build a board we're going to build the tool we're going to build an interface we're going to build it on top of this language kind of specification based on C and C++ called processing. But it's really just C and C plus plus so that anyone can write a simple program with just a few lines of code not know anything about microcontrollers and magically the initialization code that we develop new guys will start this microcontroller up whichever one it is it'll take care of all the initializations of the timers the peripherals that this that the Ethernet all the complicated things. So that just within a couple lines of code you can say do something. That's what Arduino is and that's why it got so popular and now it's very very popular platform for hobbyists. All right so our professional engineers like myself we rarely will use an art wino for anything because we're talking through layers of software. The tool is very primitive and simplistic. The performance is very low because of all this layering. But for someone that's not doing high performance computing and needs to build low level to the metal hardware and software it's a great way to build things to do things. All right. So that's what we're talking about right now. I know there's a lot to this I just want to make sure because a lot of people just don't even know what's kind of the whole Arduino story. Now let's go even farther. So the two guys that did this which I can't remember their names. That's right you're someplace I'm buying it to look for you guys can because it's going to be a long lecture. I'm not one of my long lectures. But anyway the two Italian guys we're like we're doing great. I love you you love me. And then the one guy is the hardware guy and the other guy is a software guy and they got into a fight. Right. Probably a fist fight. I don't know maybe they did. But anyway this happened a few years ago probably I don't know three years ago something like that for maybe three years ago. They got into a fight the hardware guys like no we need to focus on making more advance hardware and the software guys like no we need to make better software. So they got in a fight and like literally they split the company in half. Then what happened was they went to court and the judge said you are destroying this platform this ecosystem all your customers and this and that this is ridiculous because someone bought an Arduino and now it's not going to work with the other Arduino So they even had two Web sites like Arduino dot. And this is where I can't remember exactly but you can read about it. There is no dot org and we know dot com I believe that's what they split into and so customers are good Argentino dotcom and I think that third dot org or they go to our dot org. But they thought they were going to dot com. And they even had two versions of the eyeteeth the Integrated Development Environment which I'll talk about with that is also That's like the thing that we talked about were your program. So these guys are fighting the judge finally said you know what stop this this is ridiculous I'm forcing you to re-emerge the company. So this happened about a year ago I think or so maybe a year and a half ago they reemerged the company and now there's Arduino. CC right now they're in these domain names anyway. So now when you go there it's one company again and everything's hunky dory. But it could be confusing to you if you look back on things from the past you get confused so check it out. So if I could Arduino dot Let's go to Argentina dot org. It says Arduino. But check this out. You're now going to be redirected Arduino does CC. All right. And I'll give it five four three two one that's a long ass redirect OK there goes. Now check it out. If I go to Arduino dot.com if we get our you know it's resolving host. So it's interesting right now. OK so I can tell you right now I can't believe someone doesn't own that. That's that's interesting. Ha. OK so that's a good little website to grab that domain and I bet you somebody already has. But anyway that was the other one I think. And then no matter what. Now you need to go to we know CC. OK. So but I just wanted everyone to know this because you know I like the history of things and it's kind of interesting to see what kind of goes on and this caused the big upheaval because everyone's like are is are Leno going to be around. And should we keep messing with the software and building things with it or she would just like throw it away. Right. OK. Now now check it out. It gets even more crazy. So remember I told you there's lots of different Arduino hardware Now that's kind of Arduino compatible. All right so let's see if we go to I believe. I think if we go to buy Arduino Yeah. All right. So there's all these different the off t shirts really shouldn't be here. But if we go to I think if you go to Arduino. Yeah. Bortz and module's. All right. Shields are things that plug into our wino's are so good boards and modules. And then you can look through here and you can see all the different Arduino is out there. And like I said there's all these different variants down versions right because it started off with this one. So this you know right here that when I hover it does this which I don't like. So let's just let's actually there we go. All right so this is the very first one now this version here isn't the first one right. This is Rev 3. So over the years this has been updated and updated. It still uses the same processor though this 18 mega 3:28 P is a very very very simple 8 that processor and I believe it has 16 k a flash it's 8 bit 16 care flash and believe to care RAM or one care Ram let's see. It has 32 K 32 K of flash and then 2 k of SRAM and then 1 K of e prom. So this is very very limited right. But this is with with this microcontroller you can do a lot with this and it clocks me to 16 megahertz. I'll tell you that you can definitely clock these things up to almost 30 megahertz if you actually want to. Right. And then if you go here and click the data sheet datasheet right. Just real quick let's go click this data sheet you guys know how to read data sheets. If you went through the class already if not this might. All right. And so what's interesting right now is member I said microchip bought Atmel microchip bought Atmel and because of that microchip is a massive corporation and it was a massive corporation billion dollar corporation. A lot of the Web site is still broken. So if we just type then we're just going to type an 80 mega 3:28 P and then we'll just put datasheet all right write we'll go here and see this is on Sparke fund so on their local server. Right. All right. So anyway you read through here and you can see there's variance of this thing and then here's the the original one was the 168 that they use on the Arduino and then now they're using the 3:28. And then you kind of go through here and look at it. So 20 minutes of processing and 20 megahertz it has multiply which is a rare little 8 bit microcontrollers to have a multiplier having a divider is even more rare. And then it talks about all the different rules right. Got a bit counter's 16 bit counters got a real time counter P.W. wem channels pulsed with modulation ADC analog digital converter temperature measurement. It's got to you arts. It's got a spy interface. It's got a squirt C compatible in the spy interface which is good. Lots of power features for sleeping in low power and then different voltages that it can be ran at speed grades and all that. Anyway obviously we're going to work with this you're going to read this 452 page datasheet and I've read this and many many others hundreds and hundreds of data sheets but I've read this cover to cover before. Right. And it wouldn't hurt you to read it but you don't need to. You can use this with the Arduino philosophy tool all that and not me and not know anything about it really just so that's a black box or so. So the whole idea is we can buy this one here. All right. And now there's knockoffs and clones so there's legal and illegal knockoffs and clones right. So that's another thing. And a lot of people one of the things about Arduino is it's open hardware so you can copy it and you can even sell it. Right. But you just can't call it Arduino if you want to call something Arduino. You have to contact the Arduino guys and say hey can I call this an Arduino blank. And usually though say hey sure bro. So you can do that anyway. So there's the first one and then you can see there's all these other ones this one has Wi-Fi. This one has another. It has a module on a processor in it. Here's another one another one. This one is using another Atmel chip the Omega 25 60 which is more powerful little Arduino Nano. This one right here is a matter of fact. This is the one that we based the what do we do we did the Simon game in the course or you will if you haven't seen it yet. When we do PCB stuff in the design of just the art we know nano core just this stuff right here is what I used so that it would be compatible with Arduino. When I made the little Simond game then I put a bunch of other stuff around it. Right. But if you want something in this format right you can use it. But if you look at the tech specs check it out. It uses the same 80 mega 3:28 processor 8 that processor. All right. OK. So the whole idea if you go through here you can see they have a lot of versions that are Arduino and all that really means is some of them are fast or slow or some are based on arms some are based on different processes or some are even based on Intel processors or these that used to be. And yet like this one that I think this was an Intel module as a matter of fact all kinds of crazy stuff. And there was even more when this war was going on because the hardware Italian guy wanted way more. It was like I just went tons and tons and tons of options for people and then the other guys like no it's too complicated or confusing everybody anyway. So whichever one of these you get no matter which one you get you can program it with the Arduino tool. And if you want to do simple things it's always very very similar. Now obviously an Arduino that doesn't have wireless can't do wireless things right. So like this Arduino basically is an 8 bit microcontroller with GPI goes in a few for a. So if you want to blink these two serial communications control Motors that's that's the one that you can use that will do that. If you were to do wireless or Bluetooth you're gonna need one with wireless and Bluetooth features if you try to run code for wireless and bluetooth on this one it's obviously not going to work because it doesn't have those features. So again these interfaces insulate you from programming all that stuff it's very simple lines of code but the hardware has to support it. OK. Now that all said we can use one of these. But a lot of different companies create microcontrollers and other devices. And then what they do is they want people to use them hobbyists to start using them as well as professional embedded engineers. So what they'll do is either the company itself or just the individuals that are just like I'd like to use this with the Arduino tool will port the Arduino tool or or create support or a plugin so that the Arduino tool will recognize and be able to use that other piece of hardware. So basically make it Arduino compatible with software so that you can write an Arduino program to blinking LCD take that same program run it on here take the exact same program and run it on some other piece of hardware because they've made it compatible by adding software and creating the necessary files and so forth so that the Arduino tool itself can understand and build an executable for it. You're going to understand all this more as we go. If if this is all sound and crazy right now. OK. All right. So what are you going to do. So I want to show you what we're going to use or what we're going to use is there is a new wireless module called the ESV 8 2 6 6 and its big brother the XP 32 the 8 2 6 6 came out a couple of years ago in the Espey 32 came out about a year ago. These are price wise performance wise really almost an order of magnitude cheaper and better than anything you can get there. They're Chinese made and they're just so much better than anything else you'd get from other vendors. That costs just a lot more and are way more complicated to run. So the Chinese company called Express which I think I have here. Yeah. EXPRESS If and this company developed this and they develop these other kinds of chips so they develop the chip. And so I'm going to focus on the ESPN 32 the 32 bit version. So if you kind of go here to products and you'll see they have these this big line of things right here. So here is the ESPN 32 and then then there's some development kits and all that. So let's just talk about the ESPN so CS go here. All right and the Web site is just expressive dotcom and then it kind of explains you know what these things have now. So basically you get these kind of chips right this ESPN 32 chip and with very few parts you can build an entire wireless Bluetooth transceiver with very few parts that's very small and very cheap. These things are like a buck apiece. They're crazy cheap and crazy powerful. So they have dual core processors. And just to give you a rundown on kind of the hardware they're not arm based which is interesting. They're extensor processors 32 bit. They run up to 240 megahertz each to these cores plus a third processor the ultra low power processor that's on these chips. They have internal RAM here five or 520 kilobytes SRAM and then you know roughly the same overarm and then you know 16 kilobytes SRAM. This is not actually real time clock I forget what this is called but it is not real time clock. For what that's called anyway. So you can see there they have a lot of RAM and a lot of RAM. Then they add on a external flash and possibly an external ram called POS. And so that you can have four or eight megabytes of flash and then you can have four or eight megabytes of RAM also. Then they have all these different names. Now I'm in a I'm I apologize right now. The Chinese have crazy naming and it drives me super nuts and it's very hard to figure out what all these different things mean. So what you kind of have to do is go to Wikipedia and here's like the ESPN 2 6 6 and this is not too bad. Right if you read through here and you kind of look at this and you see all these kind of crazy names the vroom and just ridiculous names and then there's ESPN and the two in the three in the form in the five and this and that and which ones have FCC and which ones this and which one that. And then it's like wait a minute. EXPRESS If makes the chip do they make the module. Yeah they do and then there's another company I think thinker that takes the chip and makes them all. Then there's other companies and all these different companies actually make things with them right. All right. So you've got to kind of read through this and it's it's crazy making. I'll agree. Then you go to the ESPN 32 in the wikipedia and again same kind of thing shows you the architecture read through all this. All right then once you get down here you kind of read all the different variants of it right. So the variant that we're interested in is down here it's called the Rover be you know Rover w Rover. I don't know where they came up with this. And there's two variants of it. One is called the I excuse me one is called the bee the bees the the news version and then there's the ivy the ivy just means that it has antenna socket on it also a little micro antenna socket. So if you want that It's called a USFL connector. Tiny little micro connector for antennas but it has a built in trace antenna also. The reason why we like this is the newest DSP 32 chip built into a module and it supports the external ram to add more RAM. So we like that for eight megabytes of this POS ram it's called right which is pseudo static ram OK. So this is what we want. So we want something that has this module the ESV Rover be a module on it. OK. All right. And then like I said there's other companies that can make things with the chips or the modules and they sell them so it's very confusing. Right. OK OK. Now so check it out so then we go to a place like Mouser and then we type in Espey 32 Rovere right. All right. And then we see there's all these different modules. All right. And look how cheap they're $4. So this is just the module and the module has let me make it largest you can see it. That really helped not see that helps a little bit. It's got these castigated pins so you could just put this on a board and it's completely self-contained and done you look at the back of it. Here are the Pinang. It's right here is ground ground power and all the Io's it's a complete system a module you don't have to do anything but it's to program stuff you need to add a couple little things in a power. Obviously you need to do that so that people can take these and put these on a kind of carrier boards to help you out a little bit. Right. OK. So see what that's all about. So if you scroll through here and look at some of these products you can see here some big boards that have the module on there so check out like this for example so there is one of these with the rover it's called the ECP Rover kit. And again don't blame me about the names I didn't invent all this. So you can see here is this kit and I just got a few extra things on here some switches some things like that some headers. There's the module on the other side or I believe it's on the same side. I'm not sure because I don't have one of these. This one's got an LCD so you can do things with LCD. Right. OK. Now that right there is at 50 bucks 40 bucks super cheap super cheap for what you get. All right. But you go a little farther now. Here's what we're talking about. Here. This one is the Rover B. And then this one is the rover IAB which has the antenna on there. OK so let's just look at this one and again and all these crazy names for the manufacture Express actually makes these and they call these the ESV 32 devkit C dash VB right now. Crazyhorse. All right so that's what it looks like. So the module is just been mounted on this little carrier board that's a dip board dual line package so that you can plug it into like a solderless breadboard or maybe another board to experiment with it. And here's a micro USPO obviously if you're building something you wouldn't want this carry you would just want the module because you would have all this other extraneous stuff but there's not much there is a power supply there's a regulator there's a couple transistors for booting it and flashing the memory. And then this right here is a USP a serial bridge typically a FDDI chip or a silicon labs C.P. 21:00 22 100 series USP you are and then a couple of little switches couple Ltd's And that's really it. So really just a couple little things to talk to the thing from your PC Linux Mac. And then the pins are just pushed right out to these headers which are just if you look here they're just standard pins to go into a solderless breadboard. That's what we want so we want this right here right. OK. So you could get. You could buy this right here often Mouser or Digi-Key or someone similar that you can get access to. Right. Or you can get it off amazon or if you're depending on what country or in a bank. Good or Ali Baba or made in China. There's lots of different places but we want something that looks like this and it has the rover B or IB with the extra little antenna connector on it because we want kind of the latest chip with the external ram. All right so I know this is all crazy. OK so now if you go to Amazon I like showing Amazon because mostly the whole world can get to Amazon it's easy to show examples. OK. So if I type in ESPN 32 Rovere into Amazon a bunch of these things come up and there's all these different companies that basically take the module and make a little carrier board. And this isn't the same one we just looked out on Mouser. These are all kinds that like this is high let go and this is this is just this is geek arm right here. This one's actually from Express if the manufacturer can just kind of go through here and expressive expressive some are made from expressive some are made by different companies. OK. The one we want well one not the one we want but the one I'm going to use in this demo that you know we have maybe a half hour or more is the rover be module mounted on a board from geek worm. And this is what we're going to use. But now we're looking for the one that's mounted on a board which is down here someplace I believe or it's up here someplace. Let's see here. I think I think it's this one. I think it's a. And yes it is one. OK. So you there you are you purchase this item on November 14th. Thanks for that. So this is. And you know I could have got the ones off Mouser but when I went to go try and order those on that day they didn't have them they ran out of stock that fast. So I said OK I'll just find something similar and then try and find this. OK so here it is right here. Now the cool thing is is that the Arduino tool not only will let you program this but it understands it. The only differences is that when someone makes one of these when they run the pins out from the module they typically run them out you know pretty much out to each one of these pins. But you know they might put a power here they may put it this year. So the pins are slightly different so you need to pay attention between manufacturers of these boards. Geek warm expressive ate a fruit spark fun high let go you name it where the pins are. You got to kind of look up. So and this right here I can see all these IO pins. This is what goes on these pin headers. This is this pin header and this pin head is this pinhead or in this fin header. So you can see it's ground be speedy 8:34 with a blob of a block. Then there's a couple of peripherals on here. Ltds where are those Ltd's if you look right here and I know it's hard to see but the Teweles these are connected to I.O. 27 an Io's 0. So if I somehow can talk to IO 27 and 0 I can turn on the onboard Ltd's which is right here and right here. So I don't have to hook anything up otherwise I can use all these Io's to do whatever I want right now. OK. So the first thing that we got to get is we have to get one of these Espey Rover B. And you don't have to use that you can use any ESV 32 you really want but I prefer if you use the Rover B because it'll be similar to what we're doing and then it's you know they're all the same costs. I mean you might as we'll get the latest newest one and this one has four megabytes of this extra RAM right now. And then here's a pin out of it right there which I already downloaded and copied on to my computer. OK now. All right. We're getting there. We're getting there I just I just want I want you to see everything OK. Now so oops. You want to learn about the ESV so you can go onto those Web sites. Right you can go to the. And I want to show you this. But you can go on to the Wikipedia page right. And here we go here's the ESV 32. So if you just go to Wikipedia it is 32. Then you can read through here. Right. Which I suggest you kind of do kind of peruse this right. Then you also go to the expressive site here and you can go here and kind of read their stuff and all their documentation support is in here. Now again this is if you want to program it kind of natively and then really understand what's going on inside there. But if you don't really care you don't really need to do this but I suggest you do because if you're like me you like to know everything works from the atoms up OK. Then there's another Web site which is Espey and I find it for you. Yeah. ESV 32 dot net this is a really really good Web site. This is like this big list of everything you could need. So if you really are into you know wireless and IATA and you want to try out the Arduino and the XP 32 I highly recommend you read this page and scroll through it like all the documentation and there's you know tens of thousands of pages of stuff here. But it's got every piece of information you want. Right. And you can kind of go through here and see all these examples and this and that and development. And then there's what's down here hardware explaining to you and this will really really help you this is really interesting and educational So I really suggest you do this. It takes about a night or two or a weekend but it's definitely worth it. You can see it just goes on and on and the this is just all the links that I imagined going all the links right. All right so I've done that and at least once and now you know I perched it out of my memory. But I did it so I know. OK. After you go through all through this there's a lot of different documents that you might want to read. One of them. So there's no book on the ESV 32 from Express if there is they have documentation which they've written which is actually pretty good for Chinese documentation I'm I'm quite shocked actually. But there's no like books on this there's not anything big if you go to Amazon look for ESV 32 books. I think there's one now maybe. And it's basically a copy of the documentation not very good. So there's this dude this guy and his name is Colborne Africanness first name he's actually from Texas right. And I live here in Austin Texas he's from Texas. I haven't talked to him but he started with the ESB 2 6 6 and then he read about it and figured it out and wrote a book about it called the SBA 2:06 X-book. Then he did the same thing with the espie 32 and it's totally free. This book is free. And if you just google for a co-op on a book on ESPN 32 you can get it off. I forget where it is it's on one of these free booksellers that you can either give them money or give them nothing and then just download the PDA. Neal Neal Coben That's right. And anyway so this covers the ESPN 32. I've read this entire thing. And the ESPN 8 2 6 6 version that he wrote is much much better. This one definitely needs work. And it reads it's just like stream of consciousness. So let me get down to some of the actual text. All right. So there's Neal in Texas and he starts talking. So the first few pages are pretty good. It's like showing you the pin outs of things and this is important to all these different kits that we're talking about the vroom and this and the death kit and then then showing with this kit here's kind of the pin out. But remember with you might have a slightly different module. Here's the module. But then it's mounted a little bit different so these GPI those might be a little bit different. But a lot of times these numbers are always the same. So GPI 2:36 depending on where they routed it out is also ATC Channel 0. So. So the multiple functions is the same because Azol from kind of a hardware perspective so it's always the same. Right. And then there's the kit I just showed you the schematics. All this stuff is all open there's the rover kit. We just talked about. And then all these different things explain how you communicate with them serially and this and that. So this is this is not bad this really saves you a lot of time. Then what he does is he shows how to program with it with what's called the IDF the I.T. development framework from expressive. This is a C C++ library designed to be compiled with like gcc directly or maybe you could do it with C laying the other compiler and forget about Arduino that's for like you know you're kind of a hardcore embedded guy or a Linux guy and you really like doing things the command line. This will explain how to do it. It's not easy setting it up. And he had to figure this out and get it all working. But he did and he shows it and you can do that if you're really into pain and Linux. I would give this a try but if you just want to start playing with this thing don't. But again it doesn't hurt to just peruse through this. And then after a while you know it turns into just basically a giant dump of the API that expressive created with this IDF iOS development framework which gets boring. But thankfully there is a index over here we kind of go to different things and see compiling code building you know audio blah blah blah and kind of read about these different things so that this book right here is the best and only book even though I really don't like it that much compared to his previous book because this one just feels not done rushed it could have been better. I don't know. And then of course there's here's the rover data sheet which you get from the vendor. All right. This is a pretty good data sheet and not too long is only 26 pages. So just read this I would advise you read this. So the China notes going on Espey 32 Rovere always read the data sheet. This is just about Bluetooth. This is something I'm interested the ears feet 32 Bluetooth architecture. Again it's pretty short just kind of talking about how the Bluetooth works on the chip. OK then what's this thing here. This is this is the Espey chip datasheet not the rover which is the module with the chip. This is the chip. And so this is kind of talking about the chip at datasheet just electrically very high level. Now here's the nasty technical reference. This is where things get ugly. So here is the ESV 32 technical reference. Again I've read this and this. This talks about the programmers model it's 666 pages. You know the perfect number to put for anything. And so read through this if you want. You don't have to again you don't have to read any of this up and I'm saying if you really want to know I would read it. And then whenever you know and people always ask me Andri How do you build computers how do you design a single board computers how do you build an arm computer. This is how I do it I read everything. Then I read what it's called the hardware design guidelines. This is for hardware engineers. How do you build something so I got to read this and think it's only twenty nine pages pretty short. This typically shows us how to power it up how to do reset how to sequence the power systems how to maybe connected Tenez this reference schematics and gives us something to start with. So when I have to do everything ourselves and figure it all out right very very short actually and then maybe a possible layout and all that kind of stuff. Anyway that is the hardware design. So these are all the things that a hardware engineer will read and cover to cover if I want to build something and program it hardcore and really really know what I'm doing for you guys if you don't care about it you don't need to do any of that. I might read maybe the rover data sheet the 29 page thing right. And I think that's it. Yeah. So. So that's it. So those are just some things you can get them all from expressive. OK now all right. And again I don't even know what's going to happen with this right. You know I really need a lot of time to do this because this is really a whole course and I'm just trying to do it in one lecture something to tell you one thing I'm going to do I think to make this into like three lectures where we're going to try and get some stuff done this time and then I get to do a couple of more lectures we're still going to use PSP and do some more advanced things. Let's just see how far I can get. OK what are we doing. All right. So we want to program this with the Arduino tool. All right. I'm I'm a Windows person so I will use Windows if you have a Mac or Linux. It's very similar and there's a million tutorials online that can show you. So Step 1 let's go get the Arduino tool which unfortunately I already have. But how would we do that we would just go to Arduino go to software. Now they also have a new online tool which works from your web browser. I don't like anything online. So I like the real download so you go to downloads. Right. And then we download the Arduino ID so it's up to version 1 point 8 7. All right then you could see that the Windows Installer the windows zip the windows app and then Mac OS and Linux all the different variants of it. All right. So download whichever one you want. All right. And then simply install it. All right. And I'm just going to assume that you can do that. All right now once you've installed it now we need to do a couple of things so that it understands the new ESPN 32 when you install the tool so after you get done installing it. Let's look here at my desktop and try and find any semblance of anything. All right. Here we go. So here is the Arduino tool and create an icon like this this infinity icon. And then if you go on launch it could do that double click and then come up right. This actually is not the fastest thing in the world. I almost think like it's just sitting there purposely. All right. And forget forget this right here for now. Forget this right here for now. What's inside this 10 that's blank. It just loads the previous thing that I was working on. This is the Arduino idea. So if you're used to you know visual C++ or X code or even eclipse you're like wow that's super simple. It is super simple and because it's so simple you can't do a lot with it. You can basically compile and download and that's it. You can't debug you can't do anything. All right. That's it. Very very simple. All right. And then as a matter of fact let me let me just open up something real simple here. And every time. And another thing is as far as I know this the. You cannot. Yeah. There's no tapping at all. It literally opens up another window and that's life. Right. Very crude but a lot of people like this and they're fine with it so whatever. OK here's like a little blink program and we're going to get to that in a minute. OK let's go through kind of all of the things here. So obviously I can click that make this bigger if I want. All right. So we can do that. Let's that's a matter of fact. Let's do that. All right. So you go to file and we've just got the standard things up here open opened recently and we have this thing called a sketchbook. Right. And the sketchbook is basically a directory on the computer with your programs. Now normally if you in a big idea big professional one these would be your projects or your workspaces they would have tons and tons of files for each thing rather to be a zillion files in Arduino universe. There's not there's like one file your c file and then if you need any other libraries or header files maybe you put those in there if you understand what those things are if you're that advance but if not it's like literally a c file then all the other stuff the tool brings in to build it. So it really really really simplifies this. OK. Then there's that thing called examples. This is interesting what this is is a list of everything that people have contributed whatever. And there's all kinds of crazy stuff and depending on what you've got loaded or not you'll see more or less of these things so for example up top there's one two three four up to like 11 here right. And then there's examples for any board then there's examples for the ESPN 32. Now the only reason we're seeing these is because I installed this right. But if we go to a built in examples like basics and we say Blinkx here what'll happen is it can open up another window Check this out. There's a window and we can close this one now which drives me insane. And then here is the blink program. That's it. So now if we look at this program they're set up and loop. Now if you're a CC plus plus program or what's really going on here the main and CC plus plus is somewhere else. And then the main first call set up here. And again there's one thing I have to assume is that you know how to program in C or C++. A little bit if you don't you're going to be completely bewildered but if you are if you're ok to follow this I think you can still get a lot from it. And then after set up is called Main just calls this loop and then you can sit inside this loop this loop function keeps getting called in sight of main excuse me the loop function keeps getting in so called and state of Maine with a infinite while and then also in that infinite while there's a couple of calls to some interrupt stuff and this and that because the system may have to process other things so this you don't want to stay in here and put a infinit while you can but you'll break stuff. Anything else it needs to operate asynchronously. So for those of you that are C++ programmers you put everything in its little loop kind of like silly and then just make sure you exit out of here and it'll come back really quick after it does a couple of little things and then you get control back again. All right but don't stay in here don't block in this function. All right you break some things right. So we see we have this little tiny program here and if you look at it it has this one thing that just says pin mode lead built in output. All right. And then it has loop digital right let built in hi delay at 0 0 0 0 0 in digital right. Built in low delay 1000. So all this thing does is it turns one of the GPO pins into an output mode and this is defined elsewhere. This led built in is defined elsewhere and it's one of these. It's just the number. And in Arduino you know each one of the GPO has a number and it's setting it to an output and then we just drop into this next function which then just basically asserts a high it delays 1000 and wait for a second. Each one of these is a millisecond I believe. And again with art we know you have to look up these API and make sure what you think they're doing and all that and you can do that on the Reno site anyway. Digital right. Then it writes a low and then it delays again. So basically it's going to Blenkin LCD. That's what that would do. Right. And what we're going to play with that. All right. And then you can go read about it right here. OK. Now let's keep looking what else is here. So that's what all the examples are and then close up and save and then preferences. Now this is important. OK. First network settings here if you want to mess around with anything that's an advance for proxies and all that you don't really need to worry about that what you do need to worry about is this. So sketchbook location see in my computer do development into projects Espey 32 sketches so I know where this stuff is going. Right. So just put yours on C or D dev or whatever wherever you like to put things and create a directory. Typically I just call it as pure whatever the project processor is and then sketches and then it'll dump everything in here. Then there's just some editor stuff some things like this varify code after upload et cetera et cetera et cetera et cetera. Just some optimization things you can play around with these check for updates on startup. All that kind of stuff then. This is important. All right. This is where you go to find additional board. So when this thing loads up you are not going to have ESPN to 6:6 or ESPN 32. The only way you're going to get these extra packages is someone's got to give these things to to you. They have to be in a format that this tool Arduino understands compares and bring all in and there's a whole series of tutorials and documentation on if you're a vendor and you have your own microcontroller your own project your own whatever and you want Arduino to be compatible with it. You have to build a file which is a zip file etc. that has a bunch of other files and ini files and Jason files in SML files all kinds of stuff that describe everything and then contains everything all library files for the particular processor. Given that that's what this is all about here. So for the ESB to 6:6 here it is here. This is the SBA to 6:6. All right. And then if you look at it it says HDTV Arduino. ESPN 2 6 6 dot com forward slash stable for its slash package underscore ESPN 2 6 6 com underscore index that Jason. OK I will put this in the documentation and then but that is not important what we're going to put that because we want that also just in case. But here's the important one. This is the 32 bit ESV So this one is yes it's Latchford slash deal. Expressive. So this is coming right from the expressive site dot com forward slash DL package underscore ESV 13:2 underscore index that Jason this bad boy is the one that's important. So you have to add this to this preferences under the additional boards. Okay. When you do that and click OK. Cool. Now it may need a restart to be able to find this so we're just going to restart this just in case. And this is not like this hardened awesome tool. It is a Java program and it is buggy and it is slow and all that but you know it millions of people use it and they get around it. So I mean whatever. OK now. OK so now here we go. So we already did that in preferences and it's sitting there that's cool. All right. Now what we need to do is we need to go to tools and work. There's a number of things we're going to do here but one of those things is in the order we do things can change but we're going to go to a board here and it's saying what the board is right now I don't really like this. Pretend it doesn't it says the wrong board. All we want to get to this thing called board manager. We double click that and then it shows all the different boards installed. All right so what we do is when you first install this on once you type in Espey 32. All right. Once you do that then boom here it is here's the PSP 32 stuff it just found which is going to give you all the PSP 32 libraries examples sketches and all that. It's already installed. So I don't need to install it if it wasn't it would say install here or install here and then I would Sol and then say close or just it's already installed dominance a close call. OK. Now what's the next thing. So when I go here now it says Pick your. So now the whole idea is we're going to pick our actual product that we have. So I have the ECP Rover B module right. I don't have a rover of the Rover B Now the good thing about these Arduino things is a lot of times even if you don't have the exact one close enough is close enough. So now if you hadn't done what we just did you wouldn't even have any of this stuff down here all this stuff just populated after we put in that information and you scroll down and these are all the different companies that are listed now because of that insulation. Right. And there's hundreds of these boards. So obviously not they're not all here. All right. But here's one right here Espey a 32 Rover module. I have the Rover be with just has more RAM in this and that but as far as the Arduino tool is concerned the compiler the libraries it'll compile for it and build an executable and be able to upload it it'll work. And then there might be some little tweaks but that one right there seems to work. You could try another one you could say. What about the 32 pick Pico kit are there. No 32 s lots of them will still work right. They're almost identical. As far as the profiles and the software has all been loaded anyway. So I select this right here. Good. And then it goes back. OK. Don't worry about any of this stuff. This is just speed for doing things but upload as fast as possible which is as 12:51 600. The flash frequency you set it all easily default but you can tweak them if you want. Don't mess with this Q I don't. That's the mode that you want to use. Leave this as default there's other things you can do here Kord debug level leave that none. Now the port when you plug in the Arduino to your computer which we're going to actually do is to unplug and plug in and see kind of see what happens. It's going to create a serial port because there's a serial USPO a serial chip on the Arduino that's going to Cluff is a serial port so you've got to select which one com 135 that would give you a lot of trouble if you don't do that. So we've got 35. Ok cool. We don't need to get the board info that will pull information from the board. Now down here some extra stuff to make the any Arduino an Arduino it kind of has a bootloader on it and that bootloader helps. There's no tool talk to it. We don't need to mess with that right now. And if we were to do that we would have to program the bootloader chicken in the egg problem onto the board. How would we do that. Well we could use one of these tools here. These are like big tools like this. So this right here is like an Arduino. This is this just happens that this not and we know this is an AVR program or so this is used to program. And I've got I've got maybe a hundred different programmers in my lab of all kinds of different things. So that's like a $50 programmer. That's one of these it's this one here the AVR ISP M.K. too. So if I wanted to burn a bootloader onto a chip that I made I want to make it Arduino compatible so this tool could talk to it. First I'd have to use that then get the bootloader on it then I could talk to it with the tool. I know crazy. But you don't need to worry about that and then that just burns the bootloader so forget about that. So once you select the board from the board manager and load in the ESB 32 support you scroll down you'll be able to have all these different ESV 32 things pick the board you have. But I want you to get the Espey Rovere be or I'd be OK. All right. Now once you do that now we can start grabbing things added the examples and trying them. All right. Now I want to do is I want to like go look at this hardware and I want to plug this in and kind of show you what's going to happen here right. So let's go over to the bench and just take a look here. Right. OK so in front of me here we have the module plugged into a solderless breadboard. Right. And then here's another one right here. I always get two or three of everything. So if I blow something up I'm OK. So on the back here you see says geek worm. And let me zoom in just a little bit for you. Help you out. There you go. OK. So it says this 32 dash Rover dash 10 and the whole idea is got four megabytes of RAM. There's another version with eight megabytes. I think there might be a 1 megabyte or two megabyte version. But any geek worm is the manufacturer and then the express module is right there. Right. And you can see it says espie 32 Rover. Does it say that. Be on it. And that's just more or less the company gets sick of stamping every little version of everything on these metal can so they just kind of leave it off. And then like I said if I was going to build a computer or build that product I would just have the module I don't need all this stuff right here. Now this one has this extra F.L. connector. And then here's the antenna right there's the antenna right on the PCB. But then if you want to add an external antenna with more gain boom you can just plug it right in there. Then here is our this is our cereal you are USPC cereal you are there is our regulator to regulate the USV FEIBEL it's a 3.3. Couple of switches and then a couple Ltds. OK. And then I just like this so I can look at it. And then like see what these IO pins are is I'm messing with it even though I can do it on the computer. All right. OK. Now so what did I do here. So what I like to do is mount this thing on here so I can play with it and experiment and do whatever I want to do. All right. Now problem is this thing is so wide if you try to put it in just one of these solderless breadboards you're going to have no room on either side to do anything. So you need a bigger one or you need two and then you straddle the power supplies rails when you straddle it. Then you have three on this side and three on this side. OK. So what I did was and this is all plugged in right now so as a matter of fact what I'm going to do is I'm going to I'm going to unplug this because I want to see what happens. I'll unplug it and then under here there's nothing magical. All I did was I looked at the module itself. All right. And I looked at it and I said you know where is ground where is ground where is the final. Where is this ground where is 3PL where is all this. Then I labeled them like this. All right. And then this is a fireball. So if you want to put five volt in you could put it in there and that's red. This is actually orange. And this is 3.3 evil. So now the board itself is going to generate the 3.3 when you put the USV in here we get 5 volts roughly right. 4.2 4.5 to 5 5 2. It regulates down a 3.3 powers the module and then outputs it right there. That output then goes and then I use it to power this entire board. Now I don't want to put a lot of things on here because it all be powered off USP but as long as we don't go crazy we have 500 amps to work with. OK. Then I looked at all the grounds on here and then I connected them all to the ground and then again if you once you take the class you're going to know that we have power rails here we bypass capacitor and we use it like a 10 micro fair to point one ten point one ten point one ten point one and then just connect all the power cells up so everything is 3:03 and ground nice and clean and then we can put this back in here like this. And we don't want to blow up anything. There we go. So that's it. All right. And then would just wiggle it in wiggle wiggle wiggle. All right. Now we're going to we'll put this in in a second so you can see what happens again. So that's it. So now all of our projects we want to build we basically just look at the back of this and we say here's all these IO's. Now each one of these IO's can be a G.P.O. but it could do P.W. and it could do a u r it could do Ethernet it can do all kinds of crazy stuff right. Spy this and that. So it's all multiplexed and the Arduino ID knows about this. And so most things like if you want to do something on one particular IO you can tell that IO to be different things and the libraries and so forth will help that happen. But knowing what is potential or possible in each pin really helps and that's why having Coale Bon's book or another reference that shows you know every one of these Io's and it says this can also be I scored see this can also be this this can also be that that will help you so you don't try and put something on a pin that it just physically can't do. Right. OK. So anyway that's that. So what we're going to do is we're going to start off with just blinking an LCD we're going going to keep the super simple right. So what I'm gonna do is I'm just going to pull this stuff out. I've got all my stuff here as usual. And again if you're just jumping to this bonus lecture for fun then you will learn that I like to keep things super clean so I don't go crazy now. We can wire things together with separate wires like this you know and I've got them all color coded here all my different colors or we can do these. Right. And you can get these off Amazon. All right. So just for fun here I'm going to pull out just pull a few these out and split them up here. And I've got hundreds of these already split but I'd like I'd like you to see the process you know so who cares and cost so much money. Right it's not going to put me into the poorhouse. All right. So we got some wires right there so you can use those and those go real quick why don't I like these though. You guys know that because whenever we do anything like this this is very noisy. I hate that. Right. But if we're doing low speed stuff it's not going to kill us right if we're doing high speed stuff if we like when it makes something real. We take a nice piece of wire you know we bend it at each and boom and maybe we go you know here and then maybe we need to go over here. Right. And we keep it low to the board as possible for noise and so forth. Right. But the suffragan to do right now is not that big of a deal. OK. OK so now what we need to do is we want to do like the blink demo and see how would you download this on here. The first thing I want to do this I want to show you what happens when we plug this. So what I'm going to do is I'm going to plug this in and we're going to watch back on the computer what happens. All right so here we go plug it in and I'm going to wash the computer. Here we go plug this bad boy in. All right so now we're back here on the computer and let me just close at tool and then if we go look here. So nothing's happening so what's happened here is is that the the USP to you Art bridge that's on that device has already been installed in this computer and then it just gave it back to me. All right so check this out. If we go to the device manager and windows you do this in any operating system and we look under com ports check it out there it is right there. It's com 1 3 5. All right. So comment 3 3:5. But if I were to take that other module and plug it in it'll actually look it up hook it up as another comp. Let's do that for fun. All right so let's go back over. So we're back over here. So I'm just going to unplug this and then what are going to do is I'm going to get this other module and I'm just going to kind of I don't really want to mess with this too much. Maybe we can put it here. It's going to kind of put it here a little bit and we're just going to plug it in here. Here we go. So this is a different module so it's going to come up with a different I.D.. All right. So cool that's going now. When we plug that one in. Now the driver has already been installed because whatever USP to serial chip that's on there which I believe is a silicon labs. Definitely not enough to chip the drivers already in my computer so it doesn't reinstall the driver but what it does do is go here. Now both them are coming up has the same campur that happens sometimes. OK and that's OK. So the bottom line is when you do this you are going to potentially have to sit for a minute while it installs a driver for that USV to serial. So this is all done as pure cereal. There's no complicated program it's just pure cereal. That's why that bootloader is important for the Arduino. But it's already at the Arduino toolchain support within for the ESB 32 already knows how to talk ESV 32. So you don't have to worry about doing any Buller's. OK so we know it's on com 135 so it's go ahead. Minimize that. Let's go back to the bench here and let's switch back. All right. So now what I want to do is we're going to do this blinking LCD demo. Okay. And to do that we need to blink an LCD. Now there's two Ltd's that are on board right here and right here and there at Iowa I believe 0 and 27 So first I'm going to do it there see you can see it and then right after you get done with that then we're going to use one of the Io's and put this back here. We're going to use one of the other Io's here so if I turn this over like right here is here and then of course over here is bottom row. So we're going to use maybe one over here and I think I owe 15 one two three four or five. Iowa 15 is the fifth 10 from here. So if I go here one two three four five there's IOE 15. OK. So if I take that and they plug that in there. All right let's get this a center for you and maybe you guys want to zoom in a little bit a little bit. Help you out. OK. Not too much because we want to see. There we go. All right. So there's 15. And then let's take an LCD. Now the Murielle Edis usually the big sign with the big side is the ground. We'll check it out in this one on the big side is not the ground it is the opposite it's the anode it's not the cathode. So this one is tricky. So the small side is cathode right. So there it is right there we're good to go just to check that that works. Let's take. Plus So here's my plus the rail. Let me put this up just a little bit. There's my plus the rail and 3.3 volts not going to blow this thing out so good. All right so this is grounded so if I get a positive there I'm going to be good to go. I'm just going to put a little current living resistor in here 100 ohm brown black brown just because I like to do that. It's good practice for you too. OK. So there it is. So now you got to sell it in here but we don't need this one because you've got to build on here. But those are boring to use. We want to build something right so let's see if we can get these ladies to blink so I'm going to kind of keep this right here. So we have the screen and then we're going to work on the computer so that you can see what's happening in real time. All right so let's go to the computer. OK so we're back here on the computer and let's load our Arduino tool where to go where to go. There it is cool. OK so this is this is the blank and this will work just like this. We need we need to define this and change what it is. So what I'm going to do is I've already made a version of this so I'm going to say open a recent and I say blink ESV 32 and I'm going to give you these. So here's my version of it. And what you will see is I haven't really done anything and you know what it's a matter of fact. Let's also help you guys out. Let's go to preferences again. There's a Fontan here. There it is. Let's make this size 16 and cool. So that helped. All right so hopefully you can see that little bit better. OK. So if you look here I said let Pennis 15. Now also let's go here. Here is that chart that shows what's going on here. So on these pins here we see that on the the board itself. Member I said Io 27 and Io's 0 are actually connected to those two on board Ltd's through looks like what 2K resistors. So we can actually turn these Ltd's on without using anything so let's give that a try first. Right. So we're going to make lead pin. We're going to say what is it. 27 so 27. All right then we go to set up and it says lead pin output then serial begin. This I'll show you what this does. This turns on the serial port the same serial port Rania's reprograming. After this is programmed we're going to use for communicating for debugging real crude debugging. So to put it 115 k then I would go down our main loop and then our main loop we say hello program so that's going to print out on the serial terminal at the same time. It's going to turn on this LCD pin high then delay for 10 milliseconds then turn it on low and late for 10 milliseconds. OK let's make that a little bit longer. Let's make it 100 milliseconds. Cool. All right so I'm going to save that. Now let's learn what else we have on this interface. Not much people. OK so first let's go to tools we've got our ESPN 32 selected. We've got Kamo 135 selected. That's correct. We know that. That's about all there is to it. Now we got only a few buttons here. This is it. So what's this varify verify and it comes up right here and says what it is. This means compile this means compile and link and build. Basically this means compile link build and upload. So it's been uploaded over the serial port and then these right here this is just a new file. And then this one is open file and save file which is of all the things to put here. You know they just put those few little things from the File menu. That's it. This is the entire Arduino experience and it's basically C right C++. Right. So let's go so let's go ahead and let's just. Now down here I want to say I can make this. Yes. OK. Grab that. I want to see what goes on down here. All right let's go ahead let's just compile it and link it and compiling means converting it from C-code obviously into machine code and then linking means linking with any external libraries or references and then building a final final executable. So it's compiling right now and it's compiling it with gcc or C Lang and I can't I'm not sure. Like I said I don't use Argentino you know because it's a kind of a hobby technology but the two compilers GCC and C Lang ceiling's been replacing everything. I prefer it I believe. Now it kind of defaults to see length but I might use gcc. Not sure not sure. Something to figure out if you're into it done compiling sketch uses two fourteen thousand ninety two bytes 16 percent of program storage maximum is 1.3 megabytes it looks like and then global variables yada yada yada and all this. OK now remember we're on the big ESB 32 if we had been on a Arduino. With a little 32 K right. This right here look at us two hundred fourteen thousand bytes right. Little Arduino only has 32 bytes of course the program is smaller because it won't have all the complicated libraries that go along with ESV 32 right. OK so that's done so it worked great so let's go and upload it. So go ahead and hit upload and we'll be taking a look. At the ESV 32 so hopefully I'm doing a split screen kind of thing right now because I'm not going to go back to the bench or messenger with you. And there's verbosely it's also here and you can see now he went into the programming thing and the programmers written in Python and so called pi tool I think something like that. And then now let's take a look this here. All right let's back up. All right so it called. It's called ESV PI tool and it says programmer. And then it says hey the chip is this the revision code is saying what it's doing blah blah blah is saying hey I'm going to 12:51 600 baud rate and then auto detected a flash size of four megabytes compressed 8 1 9 2 bytes to 47 because there's probably much zeroes in it. And then it starts writing all these different memories that the ESB 32 has and then it's saying you know all the different percentages done and then doing a verification member we had that in the preferences do a verify so check some memory. All right. And then lastly we see this hard reset via our TS phone. So the programming interface on the on many of the ahrd Lenos is done completely serially and through a serial through USV to serial. You are like the FDDI chip or the silicon Lob's chip and so to be able to control various things on these microcontrollers they have to do it serially just with you know a serial interface so there's not much that you can do there. However most serial interfaces have a modem interface so they have Dietmar data terminal ready to send requests and they have a few extra pens. And then what they do is they take those pens from the U.S. feed a cereal you are and then kind of decided hey on the wino's we'll use a couple of these pens ETR in our TS I believe on some of the different Arduino hardware to be able to talk to the control pins on the microcontroller or on the module that control reset boot flash mode etc.. Or that what I call the strapping pins on there and then therefore through the tool the tool can control remotely to put the chip or the module into Program Mode or boot motor this or that so that we don't have to do it by pressing buttons. So anyway that's what this hard reset is. All right. So anyway you can see hopefully that the thing is blinking and it's blinking on the correct LCD. Let's go real quick and let's change this to as a matter of fact let's just Instead let's go ahead and add the other LCD. All right so there's two ladies one was it to eyeopener zero and the other one was that I opened 27. So we're just going to copy the code. All right. And we'll just call this two. And this is what's cool about this is why people like Arduino so much. The funny thing is they think they're programming in processing and they're not they're programming in C this is C I hate to tell everybody. C++ actually. All right. And then here we're going to turn this pin high. We're going to turn the other one that in fact let's do opposites will do this low. And then here we'll turn this one to make sure we get the right pins here. Of course it's always you know I'm always in a rush. And time is always against us. So I'm always trying to go as fast as possible to give you as much cool stuff as quickly as possible. All right. I just control less than say that. Let's just go hit upload and give it a minute here and this is never a fast process under Arduino with if you use the GCC or C compiler with the IDF the development framework. It's definitely faster. Right. And now we did the hard reset and there we go. And again I can't I got to look over there because you're seeing the edited version. So you can see it's blinking both ladies just as it should. So how cool is that. Now let's get that last Ltd the one that we have the wire to. We know that's on eyeopener 15. So let's go ahead and let's just undo what we just did. Undo this code and then let's make this 15 and we'll speed it up just a little bit. We'll make it 50 50. All right. And let's go ahead and upload and I'll give you all these programs in a zip file you know they're almost identical to the examples. Again we're compiling them we'll do the upload and then I'm just going to show you a couple more. So you kind of get a feel for this and you can go through all the different examples and see what works and what doesn't. You have to change these CEOs and you have to understand what's available on each GPO. But you know many of the basic ones work. And then you can see our LCD is blinking so we've talked to the pins on the board and an external pen. Let's do something else. So now I've also done a P.W. Lem. So let's go here and as usual it opens up another window. Let's close this. OK so here we go. Oh that's interesting the preferences are per file. All right. Let's just go there and hit. OK. Is that 16. I guess it is 16 huh. OK. Yeah there's a small fire right there. All right. So what this one does is it uses the P.W. software or API from the Arduino to talk to the P.W. hardware on the ears feet. Now if you were to do real p W.M. and you were programming a low level embedded CG C++ code I assure you it would take more than two lines of code. This is literally two lines of code LHD set up Elodie attach fan and then Leidy right. It's like too simple. That's why people like Arduino. All right. With this particular API that someone made. So you know I just found this little program and it looks like you set the frequency you can set it to kind of whatever to make the whole PWI and member pulse with modulation is a bunch of different pulses. Each one of the pulses has a duty cycle as you change the duty cycle. It get that one pulse gets average and then we can control the brightness and generate an analog signal so we can change the frequency. This led channel others different led channels. And I haven't looked at the API to see exactly how many and how these would map to the hardware but it seems to work right now as is sort of leave that led pin 15 which is the Pinots already connected to. So then we say OK let's channel the frequency in the resolution this is how much resolution we have to control the PWO. So in this case it's 8 bit. And the hardware might have 16 bit DWM or 8 bit P.W. wem right. So it's saying use the ape it's like it's mapped to the hardware. Even if it's 16 bit and then this basically sets it up couple of set up things attach the pin and then you can always look at these inside of the documentation for this particular API which is either made by Arduino or a third party and then we just run a little for loop here we go from 0 to 255 and then basically swipe the duty cycle so that we'll get this brightness kind of thing going on and that's it for a little delay in there so we can see it. So I didn't really change anything other than changing the cell the pin. Let's go ahead and go for it. So let's compile and upload. See what happens. And there's at least this little progress bar over here although it does not show a percentage. I wish it did it make the time seem like it goes a little bit faster but I'm always trying to be entertaining. Right. And you know it's amazing how long it takes for such a little thing. All right. And this multi-threaded enough to do that at the same time. All right. And if you look at it I've got to look at the camera Yup it's working. It's going up right and now. So now if we wanted to add to this what if we wanted to go up and go down and kind of Stroh what we could do that we could put so this. So what happens here is we're going from 0 to 255 and then we have this loop function always gets called over and over and over. Even though it exits out here it gets called again by the real C main. Right. So what we can do is and one thing you'll learn is I do I like brackets on the same column here and I like to do this and we haven't really got any programming. Now normally there's better ways to do this. Ford is going to do this like this are going to say duty cycle equals 2:55 duty cycle greater than we're going to start 2:55 and the duty cycle greater than or equal to zero. And then we're going to say duty cycle minus minus. That's it. And then we'll put the same delay here. And matter of fact this speeded up a little bit. Say 10. So it'll do an up and a down and it'll exit out of the loop. Right. Let's go ahead and give that a try. While it's compiling and doing all that the program of course is still running it hasn't told the processor to reset it does it at the very end or compiling. And now we're uploading with a little PI tool. And now it's done doing the hard reset. And it goes up and then it goes down up and down we go perfectly just like we would expect to. All right. So there is P.W. em and then I've got one last program I want to do. So the whole idea of using a wireless module is to do wireless stuff right. So let me show you this. Now there's lots of wireless demos inside of the DSP examples and so forth but so many of them don't work right and whatnot. There's a cool web site and this is a called random nerd tutorials and this guy has got classes in e-books and all that kind of stuff specifically on ESV 32 and other things and he's got this example here where he made you know some code and he shows it to you. He can just copy it here and just copy and paste this entire thing into there any kind of shows you how to do this. So random nerd tutorials ESV 32 web server. We know I.T. to kind of show you how you do this with the Arduino. So this is a good working little program. So what we need is we need to Ltds and what it's going to do is from your phone or from your browser you can control to Ltd's remotely over Wi-Fi which is really really cool. So the first thing that we need to do is we just need to hook up to Ltd's to a couple of GPI iOS. Now his code I took his code and modified a little bit because it's a little bit hard coded in and I cleaned it up a teeny tiny bit and let me go here. And show it to you. So say open recent and it is called Not Hello server red green server. Ok. So here is the program and if we look at it it's not very long. All right. So this is an entire web server. How crazy is that. All right. So will respond to HGTV requests for the page and then print the page out. So I'm not going to go through how this works. You'll have to read this but the one thing is you're going to put your SS I.D. and your password inside of SS ID and password. You'll put that yours inside there. It's going to run this thing called web server on port 80. And then what we care about is I change this because he was calling it you know using the numbers 26 and 27 like pins. And so I just generalized and call it red LCD and green LCD. And then we can set these to any pins we want so we're going to use pins 22 and 23. Here's the interesting thing. When you start messing around with Wi-Fi and Bluetooth some of these pins on the ESB won't work right anymore. You got to be careful. So as I tried a couple of different pins they didn't work and how I would find that out as I would look at the datasheet in the expressive documentation and make sure this pin can only do this or this pin can only be input and so forth. So anyway pin 22 and pin 23 which are if we look over here let me move this pin 22 and 23 right here. So they're on one of the rows. The two last pins right next to ground. And we'll look at that. We'll go over to the board and we'll actually put this together. Pin 22 and 23 what is going hook up to a red and green LCD and we'll put 22 of the red and 23 in the green. All right again we have our serial begin. And so we can see what's happening in the serial port and then down here we have this while a Wi-Fi status so it's trying to connect. And again we're talking about a few lines of code Wi-Fi takes like a thousand lines of code to get something going if you're doing low level stuff. And then we go to the main loop here. And basically it checks if you're connected and then it sends out the ACV response and so forth and the proper content headers and so forth. And then basically you've got two controls and we can click these on the screen and then as we do that then it sends back to this little web server which then controls the supercool right. So anyway you should study this and figure out again I'll put this inside of the materials right. So first thing let's do is let's go hook an LCD a red one to 22 and agreeno under-23 saw meet you over on the bench. All right so over here on the bench and now we need to know were 22 and 23 is so yeah 22 and 23 are right there the last to be foreground so 22 is the third one. All right. So all I'm going to do is I'm going to undo this and this ones are red ones. Someone put this here and that's going to go there. How easy is that. And that'll be a red one. And then it's get another 100 home. Here's another 100 ohm boom. Put that right there. Put this right here. Super simple. And then here's our green LCD and let's make sure which way this one works. So it works like that. So the ground is the ground the big one in this one the cathode looking at it. Yep that is that one. That is the big pedestal in this one there that is it. So we we should be able to turn these on and off we go back to the bench. All right we're back here on the bench. And so now what I'm going to do is I'm going to put in my SS ID and my password here. So close your eyes. Ok so I put in my password and stuff. And now we're going to upload this. Now in this example we're going to look at the serial terminal which has been running the entire time we have that we didn't really look at it with the other ones but it was actually running on and show you how to do that. I kind of forgot to show you that but I'll show you this. And that serial terminal is good. It was just printing Hello programs or whatever. And it's a good way to be able to send information back and forth so that at least two to a serial terminal and you could type in it too and we could send information back to the ESV or any Arduino. All right so in our connecting we're uploading and this program of course is bigger and it's not scrolling. All right. And it did the reset. So now should be working OK. So now so check this out so now watch what happens here. So we go up to tools and then we say cereal monitor. All right so now this is monitoring. So the serial port 135 is now still connected to the PC and now the programming hardware is not talking to it anymore in that mode. So we can look at it. All right. I'm going to go. I'm going to go manually reset and press the reset button all right. And then we see the ESB do some crazy stuff. Now here's our program running. So now says Wi-Fi connected IP address 1 9 2 1 6 8 1 2 0 0 3. So if we get a web browser or a phone and we connect to this IP address we should see this little web server. Right. So what I'm going to do here is I'm going to type that in. Right. And then I'm going to open this back up. All right. And then I'm going to put it right there. Ready. There it is. OK so here it is right here and now I'm going to press these buttons and let's see what happens so says Red State is off in green state is off and I'm looking at it looks like I'm going to press on the red one turned on red when I turn off the green when turned on Greenman turn off. So how crazy is that. So we've basically just built a web app that's running. And here's the code for it. Right here. There it is. There's a little serial monor we can see that. And then of course here's what our little web interface looks like. And let me just make this small so kind of put everything on the screen at once. And there we go. So how cool is that. That is pretty cool. As far as I'm concerned and here is the program OK. So that is it. That is what I wanted to show you with the Arduino stuff how to install the tool and get it all to work and do a couple of simple programs. And then like I said you just kind of go here to a file and go to examples. And then you just tried loading these different things many of them will work some of them will. And then there's specific Espey examples more advanced that have wireless and Bluetooth you can play with those men and try and get them to work. All right. So that's it. Now maybe in another video we'll do some other stuff. And then what I wanted to show you was this tool here I'm going to close this real quick I'm just going to give you a preview give you preview and this is vs code where to go. So visual studio code is kind of an editor that Microsoft made and then it's very powerful and then you can see here's that blinking LSD program again. Right. And then what you do is there's a piece of technology called platform IO and it's a plug in to this and then it allows us to program but you can make it program all kinds of things. Arduino is one of them. Right. So it's got support for that or other processors all kinds of things. So this is a much more advanced tool than the Arduino tool as you can see. So the next step will be maybe we'll do another video. We will install Visual Studio code then we will install the what's called platform IO plugin which is a whole series of libraries and technologies to be able to program all kinds of microcontrollers and boards and then we will see how do we build projects with platform IO and use that to program the Arduino and do debugging and all kinds of crazy stuff. All right so that's what we'll play with next and we'll kind of see what this thing is. Maybe in another bonus video like I said I'd maybe like to do three videos with Arduino and kind of have some fun with this. All right. But this will be the next thing to kind of bring it take it to the next level. All right. So I hope you guys like that. And sorry for the long video. You know how it is with me I like to do these long videos to kind of go through all this stuff right. So I see in the next one by.