Giter Club home page Giter Club logo

Comments (4)

neu-rah avatar neu-rah commented on May 9, 2024

Yes its possible, i've been using one (3 wires) but you can virtually adapt any other as the library input is generalized to streams, in this case my encoder driver (included quadEncoder.h) just outputs characters '+','-' for the movements.
Click his handled by a key/keyboard driver (also included keyStream.h), on the encoder case its a one button keyboard

from arduinomenu.

techboycr avatar techboycr commented on May 9, 2024

Thar si a great thing to know. I Am so sorry for being this dumb but would you please send me an example in how to do it?

Please!! I am desperate, I being trying and failing miserably.

from arduinomenu.

neu-rah avatar neu-rah commented on May 9, 2024

as in example/lcd_menu:

//define the pins to be used
#define encA 2
#define encB 4
//this encoder has a button here
#define encBtn A0

...

//the quadEncoder
quadEncoder quadEncoder(encA,encB);//simple quad encoder driver
quadEncoderStream enc(quadEncoder,5);// simple quad encoder fake Stream

//a keyboard with only one key :D, this is the encoder button
keyMap encBtn_map[]={{-encBtn,menu::enterCode}};//negative pin numbers means we have a pull-up, this is on when low
keyLook<1> encButton(encBtn_map);

//multiple inputs allow conjugation of the quadEncoder with a single key keyboard that is the quadEncoder button
Stream* in[]={&enc,&encButton};
chainStream<2> quadEncoder_button(in);

//alternative to previous but now we can input from Serial too...
Stream* in3[]={&enc,&encButton,&Serial};
chainStream<3> allIn(in3);

check out the example file, it runs on the lcd also used on ide demo

from arduinomenu.

SrR0 avatar SrR0 commented on May 9, 2024

Hello Rui,

many thanks for your help! It works great now with 1.6.4. I asked about
1.0.6 cause i have the libs of the 1.0.6 environment installed in my
AtmelStudio which i am using instead of the original arduino ide. I
think I have to play around a bit on installing the 1.5.x or the 1.6.x
libraries instead of the 1.0.6. But it should be a not too big problem
(planned to go this step sooner or later anyway).

regards and greetings from austria

Robert

Am 28.05.2015 um 02:36 schrieb Rui Azevedo:

//define the pins to be used
#define encA 2
#define encB 4
//this encoder has a button here
#define encBtn A0

...

//the quadEncoder
quadEncoder quadEncoder(encA,encB);//simple quad encoder driver
quadEncoderStream enc(quadEncoder,5);// simple quad encoder fake Stream

//a keyboard with only one key :D, this is the encoder button
keyMap encBtn_map[]={{-encBtn,menu::enterCode}};//negative pin numbers
means we have a pull-up, this is on when low
keyLook<1> encButton(encBtn_map);

//multiple inputs allow conjugation of the quadEncoder with a single
key keyboard that is the quadEncoder button
Stream* in[]={&enc,&encButton};
chainStream<2> quadEncoder_button(in);

//alternative to previous but now we can input from Serial too...
Stream* in3[]={&enc,&encButton,&Serial};
chainStream<3> allIn(in3);

from arduinomenu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.