Difference between revisions of "Week 3 Lab"

From Robert-Depot
Jump to: navigation, search
(Analog Input)
(Analog Input)
Line 7: Line 7:
 
</code>
 
</code>
 
* Potentiometer
 
* Potentiometer
 +
[[Image:Pot_in.png]]
 
* photo-resistor
 
* photo-resistor
 
* strain gauge
 
* strain gauge

Revision as of 21:48, 12 April 2009

from Electronic Technologies for Art

Analog Input

  • File->Sketchbook->Analog->AnalogInput

 val = analogRead(potPin);    // read the value from the sensor

  • Potentiometer

Pot in.png

  • photo-resistor
  • strain gauge

Analog Output

LED Dimming

  • File->Sketchbook->Examples->Analog->Fading

   analogWrite(ledpin, value);           // sets the value (range from 0 to 255) 

PWM (pulse width modulation)

  • lights, fading

<youtube v="62gWVWCyw_w" loop="true"/>

Motor Speed Control

  • Basic motor control (DC motors) see week 5


Sound, Tone Generation

  • sounds, tone generation