grove.grove_slide_potentiometer

This is the code for

Examples

import time
from grove.grove_slide_potentiometer import GroveSlidePotentiometer

# connect to alalog pin 2(slot A2)
PIN = 2

sensor = GroveSlidePotentiometer(PIN)

while True:
    print('Slide potentiometer value: {}'.format(sensor.value))
    time.sleep(.2)

Classes

class grove.grove_slide_potentiometer.GroveSlidePotentiometer(channel)[source]

Grove Slide Poteniometer Sensor class

Parameters:

pin (int) – number of analog pin/channel the sensor connected.

Inheritance

digraph inheritance32cd57aabf { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ADC" [URL="grove.adc.html#grove.adc.ADC",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Class ADC for the ADC unit on Grove Base Hat for RPi."]; "GroveSlidePotentiometer" [URL="#grove.grove_slide_potentiometer.GroveSlidePotentiometer",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Grove Slide Poteniometer Sensor class"]; "ADC" -> "GroveSlidePotentiometer" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
property value

Get the position value, max position is 100.0%.

Returns:

ratio, 0(0.0%) - 1000(100.0%)

Return type:

(int)