Hi Guys
I am trying to take 2 values from a keypad and initially print them to the serial monitor. at the min i can print values singly. How can i store these values from the user and then print them with my temp.???
all and any help is appreciated
#include <Keypad.h>
#include <stdio.h>
#include <string.h>
const byte numRows= 4; //number of rows on the keypad
const byte numCols= 4; //number of columns on the keypad
//keymap defines the key pressed according to the row and columns just as appears on the keypad
char keymap[numRows][numCols]=
{
{'1', '2', '3', 'A'},
{'4', '5', '6', 'B'},
{'7', '8', '9', 'C'},
{'*', '0', '#', 'D'}
};
//Code that shows the the keypad connections to the arduino terminals
byte rowPins[numRows] = {9,8,7,6}; //Rows 0 to 3
byte colPins[numCols]= {5,4,3,2}; //Columns 0 to 3
//initializes an instance of the Keypad class
Keypad myKeypad= Keypad(makeKeymap(keymap), rowPins, colPins, numRows, numCols);
char entryStr[3];
int i=0;
void setup()
{
Serial.begin(9600);
Serial.println("Min Temp = Max Temp = ");
}
void loop()
{
char keypressed = myKeypad.getKey();
if (keypressed == 'D')
{
GetMinMax();
}
}
float GetMinMax()
{
//int Num[1];
//int i = 0;
char str[3];
char keypressed = myKeypad.getKey();
i=0;
keypressed=0;
entryStr*= keypressed;*
-
i++;*
-
Serial.print(keypressed);*
-
Serial.println("Please Enter your new Min Temp");*
-
char key = myKeypad.getKey();*
-
while(key == NO_KEY)*
-
{*
-
key = myKeypad.getKey(); //UPDATE VALUE*
-
//Serial.println("Waiting for press"); //This will print as long as no keys are pressed*
-
}*
-
Serial.println(key);*
-
Serial.println("Please Enter your next number");*
-
char keypressed1 = myKeypad.getKey();*
-
char key1 = myKeypad.getKey();*
-
while(key1 == NO_KEY)*
-
{*
-
key1 = myKeypad.getKey(); //UPDATE VALUE*
-
}*
-
Serial.println(key1);*
-
Serial.println("MIN TEMP = ",(key) );*
Serial.println("Please Enter your new Max Temp"); -
char keypressed2 = myKeypad.getKey();*
-
char key2 = myKeypad.getKey();*
-
while(key2 == NO_KEY)*
-
{*
-
key2 = myKeypad.getKey(); //UPDATE VALUE*
-
}*
-
Serial.println(key2);*
-
Serial.println("Please Enter your next number");*
-
char keypressed3 = myKeypad.getKey();*
-
char key3 = myKeypad.getKey();*
-
while(key3 == NO_KEY)*
-
{*
-
key3 = myKeypad.getKey(); //UPDATE VALUE*
-
}*
-
Serial.println(key3);*
-
Serial.println("MAX TEMP = ");*
-
}*