QSlide::isTouching()\ QSlide \ Language (API) \ Wiring ALPHA 1.0
Author: Hernando Barragán
Description: Wiring is an electronic sketchbook and hardware electronics for developing ideas. It is a context for learning fundamentals of computer programming and prototyping with electronics within the context of the electronic arts.
Keywords: Wiring, Processing, Interactive Media, Electronic Arts, Programming, C, C++, Hernando Barragán

Search wiring.org.co:

Reference for Wiring version 0023+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.

Class | QSlide
Name | ### isTouching()
Examples |
    #include "QSlide.h"

    /* create a new QSlide instance
       pin 2: data ready   (drdy)
       pin 3: data in      (sdi)
       pin 4: slave select (ss)
       pin 5: clock        (sclk)
       pin 6: data out     (sdo)
       pin 7: detect       (detect)
       pin 8: proximity    (prox)
    */
    QSlide slider = QSlide(2, 3, 4, 5, 6, 7, 8);

    void setup()
    {
      Serial.begin(9600);      // begin serial communication at 9600bps
    }

    void loop()
    {
      if(slider.isTouching())  // if someone is touching the slider
      {
        int x = slider.read(); // read the slider as an integer
        Serial.print(x);       // print via serial port
      }
    }
Description | The isTouching() method returns whether the sensor is being touched or not.
Syntax |
    slider.isTouching()
Parameters |
slider | The QSlide object
Returns | HIGH or LOW
Usage | Application

Updated on November 01, 2009 12:54:50am PDT