1.1 Arduino Basics
Last updated
Last updated
Arduino is an open-source electronics platform based on easy-to-use hardware and software. It takes the messy details of microcontroller programming and wrap it up in an easy-to-use package. Arduino framework also simplifies the process of working with microcontrollers with build-in libraries.
The language is based on C and can be expanded through C++ libraries.
These functions are included with Arduino IDE to be used with the Arduino environment.
pinMode(pin,mode)
Sets a pin as an input or output
digitalWrite(pin, value)
Sets a digital output pin to HIGH or LOW
digitalRead(pin)
Reads a digital input pin as HIGH or LOW
analogWrite(pin, value)
Sets an analog output pin to a value 0-1023
analogRead(pin)
Reads an analog output pin as a value 0-1023
delay(milliseconds)
Pauses the program for a certain amount of time
Serial.begin(value)
Begins the Serial Monitor with a baud rate of value
Serial.print(value)
Prints the value (variable) to the Serial Monitor.
First, connect ESP32 Development Kit to PC and setup Arduino IDE for ESP32.
Then, write a simple sketch for serial communication print in Arduino IDE as follows.
Upload the code using the upload button.
Note: Before uploading the code make sure the ESP32 board is in boot mode, to enter in boot mode press the boot button then press the reset button then release the reset button and then release the boot button, your board will go in boot mode.