/arduino-built-in-led

A basic example of turning the built-in LED on and off on an Arduino microcontroller.

Primary LanguageC++

Arduino and the Builtin LED

A basic example of turning the built-in LED on and off on an Arduino microcontroller.

Arduino Code

Open up Arduino Create and add the following code:

// 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() {
  
  // Turn the LED on (HIGH is the voltage level)
  digitalWrite(LED_BUILTIN, HIGH);
  delay(500);
  
  // Turn the LED off by making the voltage LOW
  digitalWrite(LED_BUILTIN, LOW);
  delay(500);
  
}

View the Arduino code on Arduino Create

Curcuit

You will need to setup the following circuit using your Arduino:

Tinkercad Circuit

View the Circuit on Tinkercad

Full tutorial URL:
https://codeadam.ca/learning/arduino-built-in-led.html


Repo Resoures