Welcome, Guest
Username: Password: Remember me

TOPIC: Duplicated pin.h files

Duplicated pin.h files 3 years 2 weeks ago #481

  • lalo_uy
  • lalo_uy's Avatar
  • Offline
  • New Member
  • Posts: 18
  • Thank you received: 1
  • Karma: 0
Trying to compile for Arduino Mega board I got Brettroller running ok but the encorder.

After some sample programs I find out that there are 2 pin.h includes. one on the encoder library an other in the faspin one.
At first I beleive they where identic, so delete the one with encoder, It looks older
All worked ok but encoder do not interrupt.

I avoid pin change interrups to no avail.

This simple test
#include <Wire.h>
#include <pin.h>
#include <encoder.h>

encoder myEnc;

void setup() {
  Serial.begin(9600);
  myEnc.begin(CUI,2,3,4,0,1);
  Serial.println("Basic Encoder Test:");
}

void loop() {
  Serial.print(myEnc.getEnterState());
  Serial.print("  " );
  Serial.print(myEnc.getEncoderState(),HEX);
  Serial.print("  " );
  Serial.println(digitalRead(2));
}

getEnterState never returns diferent of 0 while the others give correct as I push the button.

Any clue?

Thanks
Last Edit: 3 years 2 weeks ago by lalo_uy.
The administrator has disabled public write access.

Duplicated pin.h files 3 years 2 weeks ago #486

  • jvetter
  • jvetter's Avatar
  • Offline
  • Senior Member
  • Posts: 62
  • Thank you received: 3
  • Karma: 1
I haven't done a ton with the encoder, but mrshake may know.

I do know that the encoder changed a bit as the boards changed so you may want to look at which version was for which and make sure you pick the right one.

Sorry I couldn't be more of a help than that.
The administrator has disabled public write access.

Duplicated pin.h files 3 years 1 week ago #493

  • adam
  • adam's Avatar
  • Offline
  • Administrator
  • Posts: 209
  • Thank you received: 19
  • Karma: 5
i don't knot he encoder code well at all, but I know there were 2 encoders, earlier was a black bodied one, the most recent is a green body and there is a setting in config for what encoder you are using. If you are not using one of the 2 we coded for, you will have to make whatever code changes are required for your own encoder.

-Adam
____________________________________
Adam Shake
Owner - BrewTroller
The administrator has disabled public write access.

Duplicated pin.h files 3 years 1 week ago #494

  • lalo_uy
  • lalo_uy's Avatar
  • Offline
  • New Member
  • Posts: 18
  • Thank you received: 1
  • Karma: 0
I got the Green one. Configured as folow:
#define ENCODER_OLD_CONSTRUCTOR
#define ENCA_PIN 3
#define ENCB_PIN 4
#define ENTER_PIN 2
#define ENTER_INT 0
#define ENCA_INT 1

The enter work ok,but the encoder is erratic. the menus scroll up an down.

one thing is wier is that the encoder library has no debounce on the encoder.
in encoder.h there is
#define CUI_DEBOUNCE 50
but is never used.

This is my encoder connections:
subir imagenes
Last Edit: 3 years 1 week ago by lalo_uy.
The administrator has disabled public write access.
Time to create page: 0.055 seconds
Follow via Facebook Follow via Twitter

Login