It's Holiday Sale Weekend at Adafruit - use the code ADATY to get 15% off items storewide! Some restrictions apply.
0

QT Rotary Encoder w/ OLED FeatherWing
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

QT Rotary Encoder w/ OLED FeatherWing

by adafruitguy on Sat Oct 16, 2021 11:33 am

The product page for Adafruit I2C QT Rotary Encoder (4991) has a picture of three rotary encoders + Feather + Adafruit 128x64 OLED FeatherWing SH1107 (4650). Is the example code for this configuration please available?

Screen Shot 2021-10-16 at 11.14.34 AM.jpg
4991 Product Page Picture
Screen Shot 2021-10-16 at 11.14.34 AM.jpg (200.58 KiB) Viewed 72 times

adafruitguy
 
Posts: 143
Joined: Sat Jun 07, 2014 7:52 am

Re: QT Rotary Encoder w/ OLED FeatherWing

by dastels on Sat Oct 16, 2021 11:40 am

It looks like https://github.com/adafruit/Adafruit_Seesaw/blob/master/examples/encoder/multiple_encoders/multiple_encoders.ino.

Always check the library examples for things like these demos. If they are anywhere, they're probably there.

Dave

dastels
 
Posts: 7870
Joined: Tue Oct 20, 2015 3:22 pm

Re: QT Rotary Encoder w/ OLED FeatherWing

by adafruitguy on Sat Oct 16, 2021 12:43 pm

Thank you! I should have been looking under the Arduino examples, not CircuitPython.

Screen Shot 2021-10-16 at 12.32.41 PM.jpg
Arduino Multiple Encoder Sketch Up and Running
Screen Shot 2021-10-16 at 12.32.41 PM.jpg (933.63 KiB) Viewed 63 times


This example works great with the following code modifications...

Code: Select all | TOGGLE FULL SIZE
#define USE_OLED true  // set to false to skip the OLED, true to use it!

Code: Select all | TOGGLE FULL SIZE
 //Adafruit_SH110X display = Adafruit_SH110X(64, 128, &Wire);

Code: Select all | TOGGLE FULL SIZE
Adafruit_SH1107 display = Adafruit_SH1107(64, 128, &Wire);


Otherwise, I'm getting the error message...
Arduino: 1.8.16 (Mac OS X), Board: "Adafruit Feather M4 Express (SAMD51), Enabled, 120 MHz (standard), Small (-Os) (standard), 50 MHz (standard), Arduino, Off"

multiple_encoders:16:59: error: invalid cast to abstract class type 'Adafruit_SH110X'
16 | Adafruit_SH110X display = Adafruit_SH110X(64, 128, &Wire);


Thanks again!

adafruitguy
 
Posts: 143
Joined: Sat Jun 07, 2014 7:52 am

Re: QT Rotary Encoder w/ OLED FeatherWing

by dastels on Sat Oct 16, 2021 1:38 pm

Ah, right. It should port to CircuitPython (using displayio) pretty easily.

Dave

dastels
 
Posts: 7870
Joined: Tue Oct 20, 2015 3:22 pm

Please be positive and constructive with your questions and comments.