0% found this document useful (0 votes)
12 views8 pages

ARDUINO

The document introduces a presentation on Arduino programming, focusing on empowering organizations through collaborative thinking and agile frameworks. It explains the basic code structure for controlling an LED with a button, detailing functions like setup, loop, pinMode, and digitalWrite. The code demonstrates how to turn on an LED while a button is pressed, highlighting the use of constants and input/output configurations.

Uploaded by

francesalguzar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views8 pages

ARDUINO

The document introduces a presentation on Arduino programming, focusing on empowering organizations through collaborative thinking and agile frameworks. It explains the basic code structure for controlling an LED with a button, detailing functions like setup, loop, pinMode, and digitalWrite. The code demonstrates how to turn on an LED while a button is pressed, highlighting the use of constants and input/output configurations.

Uploaded by

francesalguzar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

ARDUINO

Myra Rachelle G. Calipusan


AGENDA
Introduction​
Primary goals
​Areas of growth
Timeline
​Summary​
Presentation title 3

INTRODUCTION
At Contoso, we empower organizations to foster collaborative
thinking to further drive workplace innovation. By closing the loop
and leveraging agile frameworks, we help business grow organically
and foster a consumer-first mindset.
THE CODE EXPLAINED
• // - comment serves as our little notes

• const int LED = 13;


• const int means that LED is the name of an integer number that
cannot be changed (a constant) whose value is set to 13.

• void setup() - tells Arduino that the next block of code will be a
function name setup()

• pinMode() – tells Arduino how to configure a certain pin. A function


and what is inside its parenthesis is called its arguments. Arguments
are the information a function needs to do its job. Has two
arguments: one tells which pin will be used, the other one tells
whether it will be an INPUT or OUTPUT pin
THE CODE EXPLAINED

void loop() – where the main behavior of the interactive


device is specified. It will be repeated

digitalWrite(LED, HIGH) – digitalWrite allows the turning off


or on of any pin that is configured as output. Expects two
arguments: (1) tells what pin is used and (2)tells whether to
set the voltage level to 0 (LOW) or 5V (HIGH)

Delay(1000) – delays for a second


TURN ON LED WHILE
Presentation title 8

BUTTON IS PRESSED
// Turn on LED while the button is pressed
const int LED = 13; // the pin for the LED
const int BUTTON = 7; // the input pin where the
// pushbutton is connected
int val = 0; // val will be used to store the state
// of the input pin
void setup() {
pinMode(LED, OUTPUT); // tell Arduino LED is an output
pinMode(BUTTON, INPUT); // and BUTTON is an input
}
void loop(){
val = digitalRead(BUTTON); // read input value and store it
// check whether the input is HIGH (button pressed)
if (val == HIGH) {
digitalWrite(LED, HIGH); // turn LED ON
} else {
digitalWrite(LED, LOW);
}
}

You might also like