Sensors: Slides and Helpful Material

by leah

Leah’s slides
NanWei’s slides

Arduino
Processing

Switch Example from Class

Resistive Sensor Example from Class

Capacitive Sensor Example from Class

    Download and install Paul Badger’s Capacitive Sensing Library and put it in the libraries folder in your Arduino sketchbook.

    Arduino code:
    #include <CapSense.h>

    CapSense   mySensor = CapSense(11,10);        // 10M resistor between pins 11 & 10, pin 10 is sensor pin
    long start;
    long sensorValue;

    void setup()
    {
    Serial.begin(9600);
    }

    void loop()
    {
    start = millis();
    sensorValue =  mySensor.capSense(30);

    Serial.println(sensorValue);                  // print sensor output
    delay(10);                             // arbitrary delay to limit data to serial port
    }

    Processing Code (same as for resistive sensing)