CubeCell Internal Pullup

Hi,

i am bit confused. how can i activate the internal pullup resistor for the cubecell?

I’ve tried “pinMode(GPIO4, INPUT_PULLUP);”, but the Arduino IDE showed up an error while compiling.
I took a look in the “ASR_Arduino.h” and found instead of pinMode “INPUT_PULLUP” the pinMode “OUTPUT_PULLUP”. Does it makes sense?

typedef enum
{
ANALOG = 0, /** \brief High Impedance Analog /
INPUT, /
* \brief High Impedance Digital /
OUTPUT_PULLUP , /
* \brief Resistive Pull Up /
OUTPUT_PULLDOWN , /
* \brief Resistive Pull Down /
OD_LO , /
* \brief Open Drain, Drives Low /
OD_HI , /
* \brief Open Drain, Drives High /
OUTPUT , /
* \brief Strong Drive /
OUTPUT_PULLUP_PULLDOWN , /
* \brief Resistive Pull Up/Down */
}PINMODE;

Not an answer yet, but this issue on github is the same question, with an ongoing discussion.

Indeed you can use the OUTPUT_PULLUP (at least, it worked with my own tests). In the github issue mentioned above I’ve added a snipped from the documentation. You could write the following code:

// setup
pinMode(pin, OUTPUT_PULLUP);
digitalWrite(pin, HIGH);
// later, e.g. loop
Serial.println(digitalRead(PIN));

If you cannot change the code, e.g. because it is in a library: I’ve created a pull request with a workaround (defining a macro that accepts INPUT_PULLUP/DOWN as well). Again, see github.