1 00:00:00,050 --> 00:00:07,049 Hello, today I'm going to show you how a real Arduino board works 2 00:00:07,049 --> 00:00:12,050 Because until today we've been programming using a simulation 3 00:00:12,050 --> 00:00:16,050 Today I have here with me a real Arduino board 4 00:00:16,050 --> 00:00:20,050 You can see it on the right of the record 5 00:00:20,050 --> 00:00:22,050 A real Arduino board 6 00:00:22,050 --> 00:00:28,050 You can see that it looks really similar to the one we are using to simulate 7 00:00:28,050 --> 00:00:56,450 Here, in the upper part, there are the digital connections, the same way you have them on the simulation, and here I have a protoboard with three LEDs connected to it, and you see that there are three LEDs, yellow, green and red, everyone connected to these three wires, and here I have, as you can see, I have the ground connector, okay? 8 00:00:56,450 --> 00:01:00,450 I will connect them to the Arduino board. 9 00:01:00,450 --> 00:01:06,459 The ground is going to be connected to the ground here, 10 00:01:06,459 --> 00:01:10,459 and we are going to use 13, 11 00:01:10,459 --> 00:01:17,280 12 and 11, ok? We need the ground 12 00:01:17,280 --> 00:01:21,280 to close the circuit, and we need the three 13 00:01:21,280 --> 00:01:25,280 connectors to give or not energy 14 00:01:25,280 --> 00:01:29,280 to the circuit, ok? So now we have everything we need here 15 00:01:29,280 --> 00:01:34,640 the real one in the simulation we can connect everything the same way and i'm going to do it 16 00:01:34,640 --> 00:01:43,760 this way i'm going to connect three dds that are here as you can drag as you can drag 17 00:01:46,480 --> 00:01:51,409 and drag i change colors 18 00:01:57,150 --> 00:02:01,790 green all right i have the three of them i have the three resistors 19 00:02:03,310 --> 00:02:25,819 All of them have to be the number 220 ohms, 220 ohms here, 220 ohms here, and I'm going 20 00:02:25,819 --> 00:02:38,659 to connect three of them to 13, this guy is going to be red one, green one, and this one 21 00:02:38,659 --> 00:02:40,840 is going to be green one. 22 00:02:40,840 --> 00:02:49,840 It doesn't matter if they cross each other because they are not connected, each one is crossing above the previous one. 23 00:02:49,840 --> 00:03:08,439 And also I have the brown, the brown from here, with the horizontal line, black as usual, and black again, black again. 24 00:03:08,439 --> 00:03:17,259 I want to connect it in a different way. Yellow is going to be here, red is going to be here. 25 00:03:17,259 --> 00:03:33,419 it doesn't make a huge difference, it's just two things in a clear way, okay, I have all the three 26 00:03:33,419 --> 00:03:39,740 connectors, the three resistors I showed, connected to ground and the CADD is connected to the three 27 00:03:39,740 --> 00:03:45,979 connectors, okay, so I have the same circuit here, you see it is exactly the same connection, 28 00:03:45,979 --> 00:03:51,819 the three wires connected to the Arduino board and the ground to close the circuit connected here, 29 00:03:51,819 --> 00:03:57,819 Okay, now I'm going to program the simulation, I'm going to use the simulation to program 30 00:03:57,819 --> 00:04:04,819 and I'm going to program it the same way I programmed the sequence of leads, of LED's 31 00:04:04,819 --> 00:04:19,810 So, we need to program it, we need 13 high, then we wait a second, and then 13 low 32 00:04:19,810 --> 00:04:35,290 and I will do the same with 12, I can duplicate, the same with 12 and the same with 11 33 00:04:35,290 --> 00:04:47,079 because they are the three ones we are using, 11, 11 34 00:04:47,079 --> 00:04:51,079 so everything has been programmed properly, as you can see 35 00:04:51,079 --> 00:04:56,079 I can close the code just to see the data and I will simulate 36 00:04:56,079 --> 00:05:00,709 the simulation works as expected, fine, perfect 37 00:05:00,709 --> 00:05:07,329 so now, the idea of simulations is that they are really useful to check if 38 00:05:07,329 --> 00:05:10,949 everything has been designed properly, because sometimes you make mistakes when 39 00:05:10,949 --> 00:05:18,209 we are designing, and doing simulation before making the real circuit usually is a good idea 40 00:05:18,209 --> 00:05:24,870 so anyway, now we know that the simulation needs to work, how can we 41 00:05:24,870 --> 00:05:29,750 program the real circuit, the one we have here, how can we program it, okay, we need 42 00:05:29,750 --> 00:05:34,629 the code where is the code here if you press on code the code appears but we don't need the 43 00:05:34,629 --> 00:05:40,709 block the blocks are useful we need something else so here we have blocks but we need blocks 44 00:05:42,470 --> 00:05:47,189 can you see it this is the real program this is the one we are going to upload to the real 45 00:05:47,189 --> 00:05:54,470 arduino board so right click copy and we are going to open a new program that is called 46 00:05:54,470 --> 00:05:59,829 the Arduino IDE. The Arduino IDE is the program we use to program the real Arduino. 47 00:06:05,829 --> 00:06:09,509 Now I will remove the code that appears by default 48 00:06:09,509 --> 00:06:14,949 and I will paste the code generated by the simulator. I will repeat. Here, 49 00:06:19,329 --> 00:06:26,560 because of the blocks, the blocks can be translated into text 50 00:06:26,560 --> 00:06:32,000 and this text is the one i have copied and pasted here to the IDE Arduino 51 00:06:32,000 --> 00:06:36,000 now i have this program here and this is the one i'm going to upload 52 00:06:36,000 --> 00:06:41,439 to the Arduino board to upload it the first thing we need is connecting 53 00:06:41,439 --> 00:06:44,800 Arduino board to the computer as you see this wire 54 00:06:44,800 --> 00:06:52,209 it's an usb connector you can see it i'm going to connect it to the computer 55 00:06:52,209 --> 00:06:56,930 and now the Arduino board is shining there are some lights you can see them 56 00:06:56,930 --> 00:07:04,050 here for example this one and this one is Chinese no wonder so now the Arduino board is connected 57 00:07:04,050 --> 00:07:10,209 to the computer and i have opened the application the Arduino IDE to upload it i'm going to upload 58 00:07:10,209 --> 00:07:16,290 it the first thing is to check that the program is correct i click this button i have to save it 59 00:07:16,290 --> 00:07:23,889 okay and okay check everything no no mistakes here it means that it will work and now i go to 60 00:07:23,889 --> 00:07:31,889 I'm going to upload to this and click on this arrow and now the Arduino board has the code 61 00:07:31,889 --> 00:07:37,410 and what happens if we have a look at the Arduino board can you see the three LEDs shining 62 00:07:39,009 --> 00:07:44,769 it looks exactly the same way the simulation looks exactly the same so 63 00:07:46,949 --> 00:07:52,470 and I repeat I have programmed the Arduino board using this wire this USB connected to the 64 00:07:52,470 --> 00:07:57,470 the computer and using this program, the IDE Arduino, 65 00:07:59,670 --> 00:08:01,790 and in the Arduino IDE, I'm sorry, 66 00:08:01,790 --> 00:08:05,870 I have pasted the code generated by here, 67 00:08:05,870 --> 00:08:10,089 generated from the code, from the blocks, 68 00:08:10,089 --> 00:08:12,490 just translating them into code. 69 00:08:12,490 --> 00:08:15,290 This is the way we program Arduino. 70 00:08:15,290 --> 00:08:17,970 And now, perfect, the Arduino board, 71 00:08:17,970 --> 00:08:21,269 the real one works the same way, the simulation. 72 00:08:21,269 --> 00:08:29,110 see that it looks exactly the same. Okay, perfect. Maybe some of you think that it's the computer 73 00:08:29,110 --> 00:08:35,909 that is controlling the LEDs that are shining, but they are not. How do we know it? Because now, 74 00:08:35,909 --> 00:08:42,950 if I unplug this wire, the Arduino board will be off, because now the Arduino board, 75 00:08:44,070 --> 00:08:49,429 the computer is providing energy to the Arduino board. But what happens if I unplug this wire? 76 00:08:49,429 --> 00:08:58,429 I unplug it, the Arduino board has no energy, it doesn't work anymore, but I will provide energy in a different way. 77 00:08:58,429 --> 00:09:04,429 This wire, the one that appears now, comes from a source of energy and I will connect it here. 78 00:09:04,429 --> 00:09:13,429 The Arduino is not connected to the computer anymore, it has its own source of energy and again the LEDs are changing. 79 00:09:13,429 --> 00:09:18,710 So it means that the program that has been uploaded to the Arduino board remains in its memory. 80 00:09:19,190 --> 00:09:20,409 Okay, you understand the idea? 81 00:09:20,809 --> 00:09:30,529 So the Arduino board is a device that can be programmed and it can be run every program you want by itself. 82 00:09:30,629 --> 00:09:32,669 The only thing it needs is a source of energy. 83 00:09:33,009 --> 00:09:35,110 Okay, and now you can see it works. 84 00:09:35,110 --> 00:09:45,629 This is very, very important because sometimes the Arduino board are, they are on robots and they control the robot without the help of any computer, okay? 85 00:09:46,450 --> 00:09:53,710 So, I think this video tutorial has been interesting and at least you have seen a real Arduino board, okay? 86 00:09:54,370 --> 00:09:55,389 Thank you for your attention.