Im using the keypad libary to monitor the pushbuttions on my Joystick.
I used the Constrain libary to limit the pushbutton count from 0 to 3 because I want 4 Lcd menus screens.
But when I try to reference the menu in the constrain string i get and error
#include <Keypad.h>
#include <LiquidCrystal.h>
#include <Constrain.h>
Constrained menu( 2 , 0 , 3 );
const byte ROWS = 4; //four rows
const byte COLS = 2; //three columns
char keys[ROWS][COLS] = {
{'1','2'},
{'3','4'},
{'5','6'},
{'7','8'}
};
byte rowPins[ROWS] = {48, 46 , 44, 42}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {52, 50}; //connect to the column pinouts of the keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
int photoIn = 0; // photoresistor on Analogue Pin 1
int ledOut = 12; // LED on Digital Pin 7
int aiValue = 0; // input value
int setPoint = 10;
void setup() {
Serial.begin(9600);
menu = 0;
lcd.begin(16, 2);
lcd.print(" Umbrella Corp");
lcd.setCursor(0, 1);
delay(3000);
}
void loop() {
char key = keypad.getKey();
switch (key){
case '1':
menu++;
break;
case '5':
menu--;
break;
}
Serial.println(menu.value,DEC);
delay (100);
}