Compiling LED Blinking in different Boards

What is LED?

LEDs (Light Emitting Diodes) are becoming increasingly popular among a wide range of people. When a voltage is given to a PN Junction Diode, electrons, and holes recombine in the PN Junction and release energy in the form of light (Photons). An LED’s electrical sign is comparable to that of a PN Junction Diode. When free electrons in the conduction band recombine with holes in the valence band in forward bias, energy is released in the form of light.

c1

Working Procedure

setup() and loop() are two fundamental Arduino functions for controlling the behavior of your board. The Arduino framework automatically calls these functions, which form the foundation of any Arduino program.

The setup() function is only called once when the Arduino board boots up or is reset. Its goal is to set pin modes, initialize variables, and execute any other necessary setup tasks before the main loop begins. This function can be used to configure settings that should only be changed once over the board’s lifespan.

The loop() function is the heart of an Arduino program. After the setup() function is executed, the loop() function starts running repeatedly until the Arduino is powered off or reset. It contains the main code that performs the desired tasks, controls the board, user input. Whatever is included in the loop() function will be executed in a continuous loop, allowing the Arduino to perform its intended functions continuously.

 Components Required

  1. 1 X LED
  2. 1 X Resistor, 330 Ohm
  3. Breadboard
  4. Different Boards
  5. Jumper wires

 

Arduino Uno

Arduino Sketch Window

  1. After Installing the Arduino IDE.
  2. c2
  3. Select the Arduino Uno board.
  4. c3
  5. Connect the Arduino Uno via USB.
  6. c4

Hardware Setup Diagram

c5

 

 

 

LED blinking Program

int LEDpin = 13;

 //Declare an integer variable 'LEDpin' and set it to 13, which represents the pin number connected to the LED.

 int delayT = 1000;

 //Declare an integer variable 'delayT' and set it to 1000, which represents the delay time in milliseconds (1 second).

 void setup() {

 //The setup function runs once when the microcontroller is powered on or reset.

 pinMode(LEDpin, OUTPUT);

// Set the pin mode of 'LEDpin' (pin 13) to OUTPUT, indicating that it will be used to send signals to the LED.

}

 void loop() {

 //The loop function runs continuously after the setup function, creating an infinite loop.

  digitalWrite(LEDpin, HIGH);

// Set the digital output of pin 13 to HIGH (turn the LED on).

 delay(delayT);

//Wait for the duration specified in 'delayT' (1000 milliseconds or 1 second).

 digitalWrite(LEDpin, LOW);

// Set the digital output of pin 13 to LOW (turn the LED off).

 delay(delayT);

// Wait for the duration specified in 'delayT' (1000 milliseconds or 1 second) before repeating the loop.

 

c6

After Uploading the Code

c7

 

2. ESP32-WROOM-32E:

  1. Use the same Arduino IDE setup

  2. Add the ESP32 board package.

 After installing library select the port and board

 

c8
c9

 I am unable to perform the operations

So I followed the steps in below link

c10

https://randomnerdtutorials.com/installing-the-esp32-board-in-arduino-ide-windows-instructions/

 

  1. Connect the ESP32-WROOM-32E via USB.

  2. c11

 Program

#define LED 2

 

void setup() {

  // Set pin mode

  pinMode(LED,OUTPUT);

}

 

void loop() {

  delay(50);

// you can set the delay time by adjusting the parameter of delay();

  digitalWrite(LED,HIGH);

  delay(50);

  digitalWrite(LED,LOW);

}

 

After Installing this driver in my windows  I am unable to communicate to ESP Dev32 module

c12

 

c13

 

 

Program is transferred over COM10 Port to ESP Dev32 Module

c14

 


 ARM (XIAO RP2040):

1.Using the Same Arduino IDE

2.Add the RP2040 board package.

c15

3.Select the board and port for the XIAO RP 2040

c16

4. Connect the XIAO RP2040 via USB.

c17

 

 

Writing the code through Arduino IDE

// the setup function runs once when you press reset or power the board

void setup() {

  // initialize digital pin LED_BUILTIN as an output.

  pinMode(LED_BUILTIN, OUTPUT);

}

 

// the loop function runs over and over again forever

void loop() {

  digitalWrite(LED_BUILTIN, HIGH);  // turn the LED on (HIGH is the voltage level)

  delay(1000);                      // wait for a second

  digitalWrite(LED_BUILTIN, LOW);   // turn the LED off by making the voltage LOW

  delay(1000);                      // wait for a second

}

 

 

 

c18

Some of the Part is remaining to upload -Complied using Thonny Editor-Micropython