Reader small image

You're reading from  Arduino for Kids

Product typeBook
Published inMar 2017
PublisherPackt
ISBN-139781785884818
Edition1st Edition
Tools
Concepts
Right arrow
Authors (2):
Rishi Gaurav Bhatnagar
Rishi Gaurav Bhatnagar
author image
Rishi Gaurav Bhatnagar

Rishi Gaurav Bhatnagar is a creative technologist who likes to work at the intersection of design and technology. He is an Intel software innovator, Arduino maker fellow, a volunteer at Random Hacks Of Kindness, also Campus Diaries 25 under 25- Science & Tech. When he is not tinkering with technology and storytelling, he spends time building new modules for students that help fuel their curiosity and build their innovation muscle.
Read more about Rishi Gaurav Bhatnagar

Vijay Varada
Vijay Varada
author image
Vijay Varada

Vijay Varada is an artist, engineer, and entrepreneur whose motto is, create positive change in the world through art, design and technology for sustainable and exponential development and progress. He is the CEO, and cofounder of Fracktal Works, which is engaged with design and research in the field of additive manufacturing, rapid prototyping, and product design with its line of desktop and industrial 3D printers aimed at using the technology to empower the abilities of students, engineers, designers, and industries. Vijay actively contributes to open source hardware projects, particularly assistive technologies for the blind.
Read more about Vijay Varada

View More author details
Right arrow

This is key!


Our Arduino will need to know or sense if a key is placed into the keyhole. This is an input that will be given on one of the Arduinos I/O pins.

Arduino can take an input from the outside world using the digitalRead() function.

A function in programming can be thought of as a task or a group of tasks that performs or does something. There are functions to add two numbers, there are functions that can check the number of letters in a word, and there are many more. You can even write your own functions in a program.

The digitalRead() function is one such function that gets input from the outside world through one of Arduinos I/O pins.

You will also be introduced to conditional statements, namely the if and else statements, which help the Arduino make decisions depending on certain conditions.

Let's write a program that takes input from a button, and depending on whether the button is pressed or not, turns on and off an LED. You learned how to blink an LED in the previous chapter using...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Arduino for Kids
Published in: Mar 2017Publisher: PacktISBN-13: 9781785884818

Authors (2)

author image
Rishi Gaurav Bhatnagar

Rishi Gaurav Bhatnagar is a creative technologist who likes to work at the intersection of design and technology. He is an Intel software innovator, Arduino maker fellow, a volunteer at Random Hacks Of Kindness, also Campus Diaries 25 under 25- Science & Tech. When he is not tinkering with technology and storytelling, he spends time building new modules for students that help fuel their curiosity and build their innovation muscle.
Read more about Rishi Gaurav Bhatnagar

author image
Vijay Varada

Vijay Varada is an artist, engineer, and entrepreneur whose motto is, create positive change in the world through art, design and technology for sustainable and exponential development and progress. He is the CEO, and cofounder of Fracktal Works, which is engaged with design and research in the field of additive manufacturing, rapid prototyping, and product design with its line of desktop and industrial 3D printers aimed at using the technology to empower the abilities of students, engineers, designers, and industries. Vijay actively contributes to open source hardware projects, particularly assistive technologies for the blind.
Read more about Vijay Varada