00:07Welcome! In this video we'll be talking about Visual Studio Code, which allows us to program a...
00:11There is a finite number of programming languages; here we will try to program using Arduino.
00:16Activating a traffic light to see how the programming environment works
00:21Visual Code, but what is Visual Studio Code? It's a source code editor developed by
00:27Microsoft for Windows, Linux, Mac OS and Web includes support for debugging and integrated control of
00:34syntax highlighting, intelligent code completion, snippets, and code refupdating
00:40Visual Studio Code is based on the Electron framework, which is used to implement Chromium and Node.js.
00:47such as desktop applications that run on the blink layout engine includes languages of
00:53programming languages such as Python, C++, Java, JavaScript, HTML, PHP, Arduino, and others, once opened
01:03In Visual Studio Code, we can see in the extensions section on the left that we can install them.
01:08There is an extension called PlatformIO that is the most popular for programming.
01:12Microcontrollers, we add to this another extension such as Arduino, once the extension called
01:20platformio we start on home here we go to new project in new project we choose the name of
01:25the new folder, then the microcontroller to use; in this case we choose the Arduino, which is
01:31a board based on an Admel microcontroller, then we choose the folder location of the
01:36In our case, the project goes to the desktop, we choose in this folder another one called led
01:42Now we'll move on to the programming. Here we go to the src file, click on main, and we'll be able to
01:48We observed the Arduino programming code and the classic configuration before programming.
01:53To program at the beginning of nothing we establish the arduino.h extension
02:07We will use digital pins 2 red, 4 yellow, and 7 green. When connecting the LEDs, keep in mind that
02:16They have polarity, so you have to position them correctly for them to work on the LEDs; the short leg
02:22or the flattened side is the negative and will be connected to ground (GND) on the board through
02:27of a
02:27The long leg or rounded side of the resistor is the positive terminal and will be connected to the Arduino pin.
02:33This corresponds to the physical Arduino for the semaphore; we define the end value for each
02:40In void setup, we define the pins as outputs in red, yellow, and green.
02:46void loop we turn on the green LED with delay a two-second wait we turn off the green LED as
02:51low and a delay of 500 which means half a second we do the same for each LED it is observed
02:58Additionally, the Visual Studio Code programming environment is auto-completed, which means...
03:04which allows us to develop the programming as we write it
03:49Now we proceed to compile; it is observed that it is correct in its programming.
04:08Okay, but how do we simulate in Proteos without the hexadecimal dot file? For this, we'll go to...
04:14The project name is led, then we'll go to pio, then abluir, and look for the file that...
04:20The default firmware was generated (hexadecimal point). This file is in Visual Code. We are looking for the...
04:25same file path for the simulation in Proteos
04:38Finally, we move on to the simulation. Here we upload the firmware file in hexadecimal format and observe
04:44that the simulation is correct in the traffic light configuration
04:55That's all for now. Don't forget to subscribe and like!
Comentarios