The firmware version that I have in the GrovePi+ board. - version 1.2.2
Other sensors Relay, Electromagnets, Sound sensor and all works fine
But while using “Python/grove_encoder_read.py”, I am receiving value 255 even when I change encoder position.
Another question is how can i change the grove port instead of D2.
Here is the code:
import time import grovepi import atexit atexit.register(grovepi.encoder_dis) print "Reading from the encoder" grovepi.encoder_en() while True: try: [new_val,encoder_val] = grovepi.encoderRead() if new_val: print encoder_val time.sleep(.5) except IOError: print ("Error")