Introducing
Your new presentation assistant.
Refine, enhance, and tailor your content, source relevant images, and edit visuals quicker than ever before.
Trending searches
Please find your seat and take out a writing utensil and notebook.
Look closely at the code on the right.
How do you think you could use the serial readout to control an actuator? In other words, what code would you add to this code to use Photoresistors voltage readings to turn an LED On or OFF?
int sensorPin = A0;
int sensorValue = 0;
void setup()
{
//Setup a connection for serial communication
// between the Arduino and computer
Serial.begin(9600);
Serial.println("Getting started...");
}
void loop()
{
sensorValue = analogRead(sensorPin);
Serial.println(sensorValue);
delay(50);
}
today's Agenda
Lesson Objective
I can collect information from a sensor in an arduino circuit.
Mastery Skills
Sensors!
Section 2 Goals
Helpful Resources - as you work in class or at home
The Serial Monitor!
Can we use Digital Pins if we want to measure voltages BETWEEN 0V and 5V?
A window that allows us to observe the Arduino communicating with the computer.
Defined: A mapping links the Range of one set of data to the Range of another.
Does this sounds familiar?
"... a function is a relation between a set of inputs and a set of permissible outputs with the property that each input is related to exactly one output."
Look closely at this circuit. What is being "linked" here?
Re-maps a number from one range to another.
map();
map(value, inputLow, inputHigh, outputLow (or High), outputHigh (or Low))
Example:
Your assignment:
PLEASE NOTE: You MUST work with a partner. We will use the driver-navigator protocol. You will switch roles every 8 minutes.