Introduction to the Arduino IDE and programming the ESP32

The ESP32 is a series of low-cost,low-power system on a chip microcontroller with integrated Wi-Fi and dual-mode Bluetooth.It is a successor to the ESP8266.It is majorly programmed in C/C++ but also supports Micropython.
Most times the Arduino IDE, which can program a variety of boards, is used to upload code to ESP32s.
The following are some of the features that make this board popular :

Now lets begin coding but first we must install the Arduino IDE and configure it to our ESP32 Board. I use Windows so these are the steps I used:
  1. Visit the Arduino IDE download page and select the latest version you wish to download.
  2. After the download finishes, unzip the file and begin installation by choosing the components to install (preferably all) on the pop up window of the setup.
  3. Choose the Installation directory
  4. Wait till the installation progress bar is complete.
  5. In your Arduino IDE, go to File > Preferences
  6. Enter the following into the “Additional Board Manager URLs” field : https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json then click 'OK'.
  7. Search for ESP32 and press install button for the “ESP32 by Espressif Systems“
  8. Open the Boards Manager. Go to Tools > Board > Boards Manage then select ESP32 Dev kit Module
  9. Now you have an Arduino IDE with ESP32 board configured.

Building simple LED-based projects.

The code that will be used here will just be ordinary Arduino code (C) that is uploaded to an ESP32.
Traffic lights project code using esp32 and red, green and yellow leds is shown below

                        
    int red=0;
    int green=2;
    int yellow=4;

    void setup() {
        // put your setup code here, to run once:
        Serial.begin(115200);
        Serial.println("Hello, ESP32!");
        pinMode(red, OUTPUT);
        pinMode(yellow, OUTPUT);
        pinMode(green, OUTPUT);

        digitalWrite(red,LOW);
        digitalWrite(yellow,LOW);
        digitalWrite(green,LOW);
        delay(1000);
    }

    void loop() {
        // put your main code here, to run repeatedly:
        digitalWrite(red,HIGH);
        digitalWrite(yellow,LOW);
        digitalWrite(green,HIGH);
        Serial.println("Start BRAKING !");
        delay(1000);
        
        digitalWrite(red,HIGH);
        digitalWrite(yellow,LOW);
        digitalWrite(green,LOW);
        Serial.println("STOP !");
        delay(2000);

        digitalWrite(red,HIGH);
        digitalWrite(yellow,HIGH);
        digitalWrite(green,LOW);
        Serial.println("Remove your hand brakes");
        delay(1000);

        digitalWrite(red,LOW);
        digitalWrite(yellow,HIGH);
        digitalWrite(green,LOW);
        Serial.println("WAIT !");
        delay(2000);
        

        digitalWrite(red,LOW);
        digitalWrite(yellow,HIGH);
        digitalWrite(green,HIGH);
        Serial.println("Start your engines !");
        delay(1000);

        digitalWrite(red,LOW);
        digitalWrite(yellow,LOW);
        digitalWrite(green,HIGH);
        Serial.println("GO !");
        delay(2000); 
    }      
                        
                    
The above simulation can be found by clicking this link.