PaulStoffregen / Encoder

Quadrature Encoder Library for Arduino
http://www.pjrc.com/teensy/td_libs_Encoder.html
561 stars 243 forks source link

#define INPUT_PULLUP /Arduino Due #21

Closed Der-Modellmann closed 5 years ago

Der-Modellmann commented 7 years ago

If I #define INPUT_PULLUP an error occure.

Arduino: 1.8.2 (Windows 10), Board: "Arduino Due (Programming Port)"

In file included from C:\Users\gabri\Google Drive\Arduino\Programme____\achse5test.ino:12:0:

C:\Users\gabri\Google Drive\Arduino\libraries\Encoder-master/Encoder.h: In constructor 'Encoder::Encoder(uint8_t, uint8_t)':

C:\Users\gabri\Google Drive\Arduino\libraries\Encoder-master/Encoder.h:74:29: error: expected primary-expression before ')' token

pinMode(pin1, INPUT_PULLUP);

                         ^

C:\Users\gabri\Google Drive\Arduino\libraries\Encoder-master/Encoder.h:75:29: error: expected primary-expression before ')' token

pinMode(pin2, INPUT_PULLUP);

                         ^

exit status 1 Fehler beim Kompilieren für das Board Arduino Due (Programming Port).

Dieser Bericht wäre detaillierter, wenn die Option "Ausführliche Ausgabe während der Kompilierung" in Datei -> Voreinstellungen aktiviert wäre.

Is this my fault or an error in that library ?

Thanks Gabriel

dagnall53 commented 5 years ago

INPUT_PULLUP is a #define normally "invisibly" included in arduino to allow you to code the pinMode with something recognizable like : pinMode(EncoderPinA, INPUT_PULLUP); Re defining it causes issues with the compiler.

PaulStoffregen commented 5 years ago

Yes, you're correct. This is an old, invalid issue. Closing it now.