Go Down

Topic: SOLVED: Getting Error:- 'INPUT_PULLUP' was not declared in this scope (Read 5 times) previous topic - next topic

tack

OK, I know this is something to do with a change in the cores somewhere.

I'm trying to compile and upload a sketch on a 1284P.

This sketch uploads fine to a 328(P) when Arduino Uno is selected as the board, but it's failing with my Bobuino pinmapped mighty1284P board.

I'm guessing it's because there needs to be some additional definition somewhere for this new INPUT_PULLUP method.

Any help is appreciated.

holmes4

Post the code and a link to the hardware you are using!.

Mark

tack

This happens with just the Keypad_I2C examples, but is related to keypad.h

It compiles fine if I choose Arduino Uno, but fails if I choose the 1284P Bobuino variant.

G:\Drive_d\Data\Arduino\Arduino User Data\libraries\Keypad\Keypad.cpp: In member function 'bool Keypad::scanKeys()':
G:\Drive_d\Data\\Arduino\Arduino User Data\libraries\Keypad\Keypad.cpp:86: error: 'INPUT_PULLUP' was not declared in this scope

The sketch is below, but it's nothing in the sketch itself. It works fine on a 328P, whether proper Arduino or on a breadboard.

I'm using IDE 1.01

Code: [Select]
/* @file CustomKeypad.pde
|| @version 1.0
|| @author Alexander Brevig
|| @contact alexanderbrevig@gmail.com
||
|| @description
|| | Demonstrates changing the keypad size and key values.
|| #
    Use with I2C i/o G. D. (Joe) Young Feb 28/12
*/
#include <Keypad_I2C.h>
#include <Keypad.h>        // GDY120705
#include <Wire.h>

#define I2CADDR 0x20

const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
//define the cymbols on the buttons of the keypads
char hexaKeys[ROWS][COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};
byte rowPins[ROWS] = {3, 2, 1, 0}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {7, 6, 5, 4}; //connect to the column pinouts of the keypad

//initialize an instance of class NewKeypad
Keypad_I2C customKeypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS, I2CADDR);

void setup(){
//  Wire.begin( );
  customKeypad.begin( );        // GDY120705
  Serial.begin(9600);
}
 
void loop(){
  char customKey = customKeypad.getKey();
 
  if (customKey != NO_KEY){
    Serial.println(customKey);
  }
}


Nick Gammon

The pins default to input, so if you just digitalWrite (pin, HIGH) that will have the same effect.

stratosfear


tack,

The Mighty1284p core files lack that instruction.  I've had great success using the standard core files with my 1284p boards for several months.  Try the following change in the boards.txt file for your board:

Code: [Select]

#bobuino.build.core=arduino:arduino
bobuino.build.core=standard



Jon

Go Up