Pages: [1]   Go Down
Author Topic: Keypad library issue with ATMega1284p  (Read 302 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am having an issue porting an alarm project of mine over from a Mega2560 board to an ATMega1284p chip and I was hopping someone could help me.

When I have the Mega board selected the program compiles and uploads just fine but when I select the 'Might 1284p 16MHz using Optiboot' option I get the following error while attempting to compile:

C:\Users\Initial Force\Desktop\arduino-1.0.3\libraries\Keypad\Keypad.cpp: In member function 'bool Keypad::scanKeys()':
C:\Users\Initial Force\Desktop\arduino-1.0.3\libraries\Keypad\Keypad.cpp:86: error: 'INPUT_PULLUP' was not declared in this scope

Here is my Pin deceleration, changed for the ATMega1284p chip, otherwise the program is identical to the Mega2560 version:
--------------------------------------------------------------------------------------------------------
const char Version[] = "v0.34a";
// Libraries
#include <LiquidCrystal.h>
#include <Keypad.h>

// Initialize the library with the numbers of the interface pins
LiquidCrystal lcd(6, 7, 0, 1, 2, 3);

//Pin Decleration
const byte TonePin = 15;                        // Piezo Speaker Pin number
const byte SignalLEDPinRed = 20;                // Signal LED Pin Red
const byte SignalLEDPinGreen = 19;              // Signal LED Pin Green
const byte ArmedLEDPinRed = 22;                 // Armed LED Pin Red
const byte ArmedLEDPinGreen = 21;               // Armed LED Pin Green
const byte LiPoLEDPinRed = 12;                  // LiPo LED Pin Red
const byte LiPoLEDPinGreen = 11;                // LiPo LED Pin Gree
const byte SwitchPin = 10;                      // Toggle Switch Pin
const byte LCDBacklight = 4;                   // LCD Back Light ON/OFF Pin
const byte SirenPin = 16;                       // Siren Output Pin
const byte LiPoTestPin = A7;                    // Input for battery voltage read
const byte HardResetPowerPin = 14;              // Reset module power pin (powers capacitor)
const byte HardResetTriggerPin = 13;            // Reset Trigger

// Keypad Library
const byte ROWS = 4; //four rows
const byte COLS = 4; //three columns
char keys[ROWS][COLS] = {
  {'1','2','3','A',},
  {'4','5','6','B',},
  {'7','8','9','C',},
  {'*','0','#','D',}
};
byte rowPins[ROWS] = {A0, A1, A2, A3}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {A4, A5, 17, 18}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
--------------------------------------------------------------------------------------------------------

Does the 1284 not have build in pullup resisters and that's why I am getting this error?
What am I missing here? The program compiles fine using an Mega2560, UNO and Pro Mini...
Does the Keypad library not support the 1284p chip?

Any help would be appreciated. Thanks.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 551
Posts: 46266
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

First question is why are you downloading libraries into the core library directory? That is NOT where user downloaded libraries go.

Second question is why didn't you bother looking for an answer, first. There is an active thread in this forum discussing the INPUT_PULLUP keyword for the 1284.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

First question is why are you downloading libraries into the core library directory? That is NOT where user downloaded libraries go.

Second question is why didn't you bother looking for an answer, first. There is an active thread in this forum discussing the INPUT_PULLUP keyword for the 1284.

To the first question, I keep it there so I can copy my entire Arduino folder and my Projects folder (both on desktop) with my sketches to a flash drive and take it with me and I never had a problem using this method. You also don't get the arduino folder in 'Documents' when you are using the stand alone copy instead of the system installed version (or at least it does not establish or pull from that location even if established with my stand alone copy).

To the second question, did a search and couldn't find it (or maybe I was too tired to see it right in front of me idk). Did a second search a couple of minutes ago and found the answer: http://arduino.cc/forum/index.php/topic,142041.30.html
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why did you lock the topic?

You are better off using the libraries sub-folder, and copying the entire sketch folder (including your project and your libraries). Your method is going to make you lose your libraries when you update the IDE.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why did you lock the topic?

You are better off using the libraries sub-folder, and copying the entire sketch folder (including your project and your libraries). Your method is going to make you lose your libraries when you update the IDE.

Had locked it because I figured there was no point having a second discussion going when there already is one on the exact same issue.
Logged

Pages: [1]   Go Up
Jump to: