In line 31 I'm trying to set the variable key equal to the variable key1. I cant figure out what primary expression it is looking for. Can anyone point me in the right direction?
I'm aware the code following is going to need alot of adjustment also I just haven/'t gotten down there yet
Thanks!
#include <Keypad.h>
#include <Wire.h>
const byte ROWS = 4; //four rows
const byte COLS = 4; //three columns
char key;
char keys[ROWS][COLS] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
byte rowPins[ROWS] = {2, 3, 4, 5}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {6,7,8,9}; //connect to the column pinouts of the keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
//---------------------------------setup------------------------------------------------//
void setup(){
Serial.begin(9600);
Serial.println("How many milligrams would you like? "); // tell serial monitor to print message
char key = keypad.getKey();
if (key != 'D'){
key = int key1;
}
}
//----------------------------------loop-----------------------------------------------//
void loop(){
//Serial.print("Press a key "); // tell serial monitor to print message
//char key = keypad.getKey();
// just print the pressed key
// if (key){
Serial.println(key);
}
// this checkes if 4 is pressed, then do something. Here we print the text but you can control something.
if (key =='D'){
Serial.println("Enter was pressed");
}
}