Loading... Please wait...

Grove Rotary Dial with Button

Hover over image to zoom

  • Image 1
  • Image 2
  • Image 3
  • Image 4
  • Image 5
$5.95
SKU:
0224-GROTARYB-DSBT
Current Stock:
98

 Product Description

Grove Rotary Dial with Button

This is a Grove 20-step rotary encoder breakout board with a nice ‘clicking’ feel. and has a pretty handy select switch (by pushing in on the knob). The encoder is different from a potentiometer in that an encoder has full rotation without limits. The unit outputs gray code so that you can tell how much and in which direction the encoder has been turned.

This unit does not come with a knob and the shaft is 6mm.

3.3V and 5V compatible

 

Grove Connectors

There are two Grove Connectors on this board.   One for the Rotary Encoder and one for the Push in Button.   Both are supported in the software.

 img-4446anno.jpg

Downloads

Raspberry Pi Pure Python Software - SDL_Pi_RotaryButton - includes example of use code

Arduino Rotary Dial and Button Software Readily Available

 

Software Example

 

 

Python Code

 

#!/usr/bin/env python
#
# Test SDL_Pi_RotaryButton
#
# January 2017
#

#imports

import sys
import time
import datetime
import SDL_Pi_RotaryButton



# Main Program

print ""
print "Test SDL_Pi_RotaryButton Version 1.0 - SwitchDoc Labs"
print ""
print "Sample uses:"
print " SDL_Pi_RotaryButton_Enc_A = 4"
print " SDL_Pi_RotaryButton_Enc_B = 5"
print " SDL_Pi_RotaryButton_RotaryButtonClick = 21"
print ""
print "Program Started at:"+ time.strftime("%Y-%m-%d %H:%M:%S")
print ""


rotary = SDL_Pi_RotaryButton.SDL_Pi_RotaryButton()





print "Reading Rotary"
print "Button stops read Reading Rotary"
# example readRotary
currentValue = 0
# readRotary(currentValue, bottomRange, topRange, increment, timeout, buttonTimesOut)
rotary.readRotary(currentValue, -30, 30, 0.5,10.0, True)
while (not rotary.checkIfRotaryDone()):

        print "rotary current value = ",rotary.readCurrentValue()
        time.sleep(0.2)

print "final rotary value =", rotary.readCurrentValue()

# now show how to use button seperately

print "hit rotary button to quit"
while (not rotary.hasButtonBeenPushed()):
        print "no button"
        time.sleep(0.5)
print "button pushed"

 

Output from Raspberry Pi

 

pi@RPi3-62:~/SDL_Pi_SmartPlantPi/SDL_Pi_RotaryButton $ sudo python testReadRotary.py

Test SDL_Pi_RotaryButton Version 1.0 - SwitchDoc Labs

Sample uses:
	SDL_Pi_RotaryButton_Enc_A = 4
	SDL_Pi_RotaryButton_Enc_B = 5
	SDL_Pi_RotaryButton_RotaryButtonClick = 21

Program Started at:2017-01-14 14:08:30

Reading Rotary
Button stops read Reading Rotary
rotary current value =  0
rotary current value =  0
rotary current value =  0
rotary current value =  0
rotary current value =  0
rotary current value =  0
rotary current value =  0
rotary current value =  0
rotary current value =  1.0
rotary current value =  1.0
rotary current value =  1.0
rotary current value =  1.0
rotary current value =  1.0
rotary current value =  1.5
rotary current value =  0.5
rotary current value =  0.0
rotary current value =  -0.5
rotary current value =  -0.5
rotary current value =  -0.5
rotary current value =  -0.5
rotary current value =  -0.5
rotary current value =  -0.5
final rotary value = -0.5
hit rotary button to quit
no button
no button
no button
no button
no button
no button
button pushed
pi@RPi3-62:~/SDL_Pi_SmartPlantPi/SDL_Pi_RotaryButton $ 

 Find Similar Products by Category

 Product Reviews

This product hasn't received any reviews yet. Be the first to review this product!

You Recently Viewed...

 

What's News

newsletter

Copyright 2017 SwitchDoc Labs. All Rights Reserved.
 Sitemap

Click the button below to add the Grove Rotary Dial with Button to your wish list.