I wrote a sketch that successfully interfaced between a keypad and Sparkfun's Serial Enabled 20x4 LCD screen. It's main functionality is to take input from the keypad, display it on the screen, and return it to the user when the enter key is pressed. This is a part of a larger project, so I decided to make it into a library to keep all my code organized. This is my first time writing a library. I wrote the entire library and created a test sketch to test its basic functionality. When I try to compile the sketch, I get a long line of "X was not declared in this scope" errors. Here is the actual readout:
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp: In function 'void print(char*, int)':
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:220: error: 'moveCursorToPosition' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp: In function 'void clearDisplay()':
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:228: error: 'secondKeyActive' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp: In function 'int keypadCheck()':
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:281: error: 'keypadAddress' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:299: error: 'pinState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:317: error: 'pinState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:317: error: 'newButtonState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:318: error: 'pinState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:318: error: 'newButtonState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:319: error: 'pinState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:319: error: 'newButtonState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:320: error: 'pinState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:320: error: 'newButtonState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:323: error: 'pinState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:323: error: 'newButtonState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:324: error: 'pinState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:324: error: 'newButtonState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:325: error: 'pinState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:325: error: 'newButtonState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:326: error: 'pinState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:326: error: 'newButtonState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:329: error: 'pinState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:329: error: 'newButtonState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:330: error: 'pinState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:330: error: 'newButtonState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:331: error: 'pinState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:331: error: 'newButtonState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:332: error: 'pinState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:332: error: 'newButtonState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:335: error: 'pinState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:335: error: 'newButtonState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:336: error: 'pinState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:336: error: 'newButtonState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:337: error: 'pinState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:337: error: 'newButtonState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:338: error: 'pinState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:338: error: 'newButtonState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:345: error: 'newButtonState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:345: error: 'buttonState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:350: error: 'secondKeyActive' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:359: error: 'newButtonState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:366: error: 'buttonState' was not declared in this scope
/Users/tjsmith/Documents/Program Data/Arduino/libraries/Keypad_LCD/Keypad_LCD.cpp:371: error: 'secondKeyActive' was not declared in this scope
Most of the variables that are not declared in the scope exist in earlier functions in my .cpp file and do not cause error messages, so I have no idea what's going on. Attached are my .h and .cpp files. I figured they were too big to include in the post. Thanks for any help!
Keypad_LCD.h (1.4 KB)
Keypad_LCD.cpp (14.6 KB)