Getting Started with the Arduino – Controlling LEDs (Part 1)

Arduino – Controlling LEDs

Session 2

Tues 10th Sep

1 / 21
next
Slide 1: Slide
New lesson editorMathematicsHigher Education (non-degree)

This lesson contains 21 slides, with interactive quizzes and text slides.

time-iconLesson duration is: 45 min

Items in this lesson

Arduino – Controlling LEDs

Session 2

Tues 10th Sep

Learning Objectives

At the end of the lesson you will be able to understand the basics of controlling LEDs with an Arduino.


At the end of the lesson you will be able to write and upload simple Arduino sketches to blink an LED.


At the end of the lesson you will be able to modify Arduino code to change LED blinking rate.


At the end of the lesson you will be able to control multiple LEDs with an Arduino.

What do you already know about controlling LEDs with Arduino?

Introduction to controlling LEDs with Arduino

Understanding the basics of using an Arduino to control LEDs.


1-Connection (how to connect LED & Arduino together)

2-Protective resistor


Instructions for controlling an external LED with Arduino

Emphasizing the need for a resistor and correct polarity when controlling an external LED.

Understanding electrical signals in the context of Arduino

Explaining HIGH and LOW signals in the context of Arduino and their significance.

Step-by-step guide to blinking an on-board LED

Explaining how to blink the on-board LED connected to digital pin 13 using the 'Blink' program.

Changing the digital pin used to control an LED

Providing instructions for changing the pin that powers the LED.

Controlling multiple LEDs and synchronizing their blink rate

Explaining how to control multiple LEDs and synchronize their blinking by adjusting the program code.

Definition List

HIGH signal


LOW signal


delay()


pinMode()


digitalWrite()


Write down 3 things you learned in this lesson.

Ask 1 question about something you haven't quite understood yet.

which one is a digital input?

A

Temperature sensor

B

LED

C

Button

D

Speaker

which one is output?

A

Temperature sensor

B

LED

C

Button

D

Speaker

Which function is used to initialize code in an Arduino program?

A

begin()

B

setup()

C

start()

D

init()

Which Arduino function is used for running code continuously?

A

run()

B

repeat()

C

loop()

D

forever()

What is the default baud rate for serial communication in Arduino?

A

4800

B

9600

C

14400

D

 19200

What does the 'digitalRead()' function do in Arduino?

A

Reads an analog value from a pin

B

Sets a digital pin to HIGH

C

Reads a digital value from a pin

D

Turns on an LED

How do you write a value to a digital pin in Arduino?

A

analogWrite(pin, value)

B

digitalWrite(pin, value)

C

writeDigital(pin, value)

D

pinWrite(pin, value)

What is the correct syntax for defining a variable in Arduino?

A

var int = 5;

B

define int 5;

C

int myVariable = 5;

D

set int 5;

Write down 2 types of variables in Arduino