I’m trying to make the RGB Rotary Encoder Breakout DEV-15083 work.
I’m using 3.3 volts.
When I connect to the Encoder board to the MCU and send I2C commands the only response I get from the Encoder board is 0xFF. According to the Qwiic Twist Register Map, I should get 0x5C from the ID register and 0x0100 from the firmware_MSB/LSB registers but I get 0xFF for these and ALL the other registers.
I started with the default 7-bit I2C address of 0x3F but then soldered the jumper to make the I2C address be 0x3E. The results were the same - I only receive 0xFF.
I have confirmed that I am sending the correct code and receiving 0xFF using:
an oscilloscope
a Diligent Analog Discovery 2 analyzer
RealTerm: Serial Capture Program
Tera Term
If I connect my oscilloscope to Rotary Encoder SW1 terminals A and B, I see the pulses as the knob is rotated but the ATtiny 84 dosn’t respond.
I have done the above using the Qwiic connectors and using the hard wire connections.
I’m connected to a 18F4550 MCU. I’m using my code.
Additional Information:
I have a program that sequentially polls the board with I2C addresses from 0x00 to 0xFF. I just tried this software again with the following SparkFun boards:
GridEYE AMG8833
AS7263 Spectral Sensor
Qwiic IR Breakout SPX-15804
Rotary Encoder DEV-15083
Using the same circuitry and the same software the first three responded with their correct addresses but the Rotary Encoder did not respond.
It seems to me that there is something wrong with the Rotary Encoder board. Do you agree?
Sorry for the delay, we’re short staffed and working remotely.
If it’s not responding to an I2C scanner, the only thing I can assume is that something is wrong with the board. I’ll get a replacement sent out to you ASAP. I’ve created replacement ticket# 22714 for you.
Is a Click event from turning the encoder, or by pressing down on the button? twist.isClicked returns true if the button has been pressed, and twist.getCount changes if the encoder has been turned. At least that’s how I am using the library.
chris101:
Is a Click event from turning the encoder, or by pressing down on the button? twist.isClicked returns true if the button has been pressed, and twist.getCount changes if the encoder has been turned. At least that’s how I am using the library.
This is how it works, at least empirically. “isPressed” returns true when the button is held down (ie, it’s pressed down). “isClicked” returns true when the button has been pressed and released.
To see this in action, bring up Twist Example1_BasicReadings, and add the following code after the “if(twist.isPressed()” line…
The notion of “has been clicked” is how it’s referenced in the Qwiic Button library, too, except there it’s actually called “hasBeenClicked()”, instead of “isClicked()”, which makes a little more sense.
Edit to add - Example5_TimeStamps already shows this without modification, too! In addition, you can use it to see that “isPressed()” only returns true while the button is indeed pressed, and “isClicked()” only returns true once the button has been released. So, if your code has “been away” for a bit, and you need to determine if someone quickly pressed and released the button, you might have to do something like: