grove.grove_rotary_angle_sensor

This is the code for

Examples

import time
from grove.grove_rotary_angle_sensor import GroveRotaryAngleSensor

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

sensor = GroveRotaryAngleSensor(PIN)

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

Classes

class grove.grove_rotary_angle_sensor.GroveRotaryAngleSensor(channel)[source]

Grove Rotary Angle Sensor class

Parameters:

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

Inheritance

digraph inheritancebee612b163 { 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."]; "GroveRotaryAngleSensor" [URL="#grove.grove_rotary_angle_sensor.GroveRotaryAngleSensor",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 Rotary Angle Sensor class"]; "ADC" -> "GroveRotaryAngleSensor" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
property value

Get the rotary angle value, max angle is 100.0%

Returns:

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

Return type:

(int)