Hello guys am new to arduino and I was wondering how do I use a 4 by 4 keypad such that when I input my value let's say 10 and I press A(enter/start)
It will multiply with value x and then set ouput pin high when the value is attained the output pin becomes low
what have you tried?
do you know how to listen for the input and get that in some buffer?
Your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with nor for advice on yoyr project.
boolean isOn = false;
unsigned long startTime;
unsigned long interval;
void loop()
{
char key = keypad.getKey();
if (isOn && millis() - startTime > interval)
{
// Time to turn the OutputPin off.
digitalWrite(OutputPin, LOW);
isOn = false;
}
switch (key)
{
case '*': // Clear
InputValue = 0;
InputLength = 0;
break;
case '0'...'9':
InputValue *= 10;
InputLength++;
InputValue += key - '0';
break;
case 'A': // Enter
isOn = true;
startTime = millis();
interval = InputValue * x;
digitalWrite(OutputPin, HIGH);
InputValue = 0;
break;
Thanks let me try
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.