Changes

Jump to: navigation, search

Week 3 Lab

184 bytes added, 06:09, 13 April 2009
Analog Input
== Analog Input ==
* File->Sketchbook->Analog->AnalogInput
<code>
val = analogRead(potPin); // read the value from the sensor
</code>
* Potentiometer
[[Image:Pot_in.png]]
* Q: What will the voltage at A_IN be? What are the upper and lower values?
* The important part of this sketch is the line where the microprocessor reads the analog input:<code> val = analogRead(potPin); // read the value from the sensor</code>* Q: Looking at the Arduino help for the that function (<code>analogRead()</code> function), what will do you think the value <code>val</code> will be for those highest and lowest voltagesin the previous question?* Q: How can you verify your idea?=== other loads ===
* photoresistor from your 147A kit... 160k - ~10k (depending on your lighting conditions).
* Q: With the same 10k resistor from the schematic above, what range of voltages (and corresponding data values) would you expect to see with this?
* Q: How could we verify this?
 
* strain gauge
* ultrasonic rangefinder:
== Analog Output ==

Navigation menu