Arduino 5 - Inputs: Mr. Mcbrien Tej2O
Arduino 5 - Inputs: Mr. Mcbrien Tej2O
Mr. McBrien
TEJ2O
Yesterday
PWM
Today
Our sketch can change its behaviour based on the value from a given pin.
Monitor
Switch
Pressed? No
Yes
Start
Function
Arduino Input Sources
Users
Internet
Sensors
Other devices
User Inputs to the Arduino
Connecting hardware to the Arduino makes it possible for a user to change its
behavior:
Switches
Dials
Keypads
Touchscreens
More !
Examples
There are many kinds of sensors that Arduinos can monitor much like a
switch.
Sensors change their electrical behavior in response to the environment
Sensors can detect:
Light (or lack of light)
Infrared
Moisture
Heat (or its lack)
Much, much, more.
Examples
Other devices can connect to the Arduino if they have appropriate output:
Virtually any type of electrical output
Bluetooth
Optical/IR remotes
You may not have a pushbutton handy – don’t forget that you can get
the same result from touching two jumpers together.
Activity 2 – Use a Button to Change LEDs
If/then/else
Digital Read
Analog Read