![]() ![]() First argument is a pin number and second value to this function is logic state ‘HIGH’ or ‘LOW’. digitalWrite(pin_number, LOGIC_HIGH_LOW) : This function is used to control digital output pin.For example, if we write pinMode(22, OUPUT), it will declare pin number 22 as a digital output pin. Second argument to this function is in which direction you want to use a digital pin. First argument to this function is pin number to which you want to declare either as a input or output. pinMode() : This function is used to select input output pin mode either as a input or output.If you have already used Arduino IDE for Arduino or esp8266 programming, you will be already familiar with these functions : To write code for LED blinking using ESP32, first, you need to understand three main functions used in Arduino IDE to control general purpose input output pins. If you want to use GPIO pins to drive any other device which has a higher current requirement, you should connect a transistor in between or current driver integrated circuit like ULN2003 relay driver circuit IC.So current limiting resistor is used to limit current not crossing this limit. Each pin can provide a maximum of 10mA current.Resistor is used as a current limiting resistor. Connected other end of the LED with ground through 330 ohm resistor.Connect GPIO22 with the anode or positive pin of the LED.Now make the circuit connection according to the above circuit diagram on the bread board. Now check the schematic and make it on your breadboard as shown below: ![]() Therefore, you need to check its datasheet before using pin number in programming which I will explain in the programming part of this article. On different boards, these pins can be located at different locations.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |