Reference for Wiring version 1.0 Build 0100+ If you have a previous version, use the reference included with your software. If see any errors or have any comments, let us know.
Class | Potentiometer |
---|---|
Name | getSector() |
Examples | #include <Potentiometer.h> #include <LED.h> LED ledBelow = LED(12); //object LED below at digital 12 LED ledAbove = LED(13); //object LED above at digital 13 Potentiometer potentiometer = Potentiometer(2); //a Potentiometer at analog in 2 void setup() { potentiometer.setSectors(2); //split the Potentiometer into two sectors } void loop() { if (potentiometer.getSector()==0) { ledBelow.on(); ledAbove.off(); } else { ledBelow.off(); ledAbove.on(); } } |
Description | Get the current sector of the Potentiometer. |
Syntax | getSector() |
Returns | The value of the Potentiometer (0,sectors) |
Usage | Application |