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 | setSector() |
||
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 | Set the current sector of the Potentiometer. | ||
Syntax | setSectors(newSectors) |
||
Parameters |
|
||
Returns | None | ||
Usage | Application |