keypad

Mr please help me in making the program, because I no constraint in making program.
I attach below the workings of a system of my tools
if the keypad button 1 is pressed select the menu, in the conditions of the menu there are two options.
the first option set time, the second option set temperature.
heater will run by one of the choices.
if selected set time, then set the time how long to activate the heater flame then press the “#” for OK “*” to clear.
and if select the set temperature, the heater will flash when the set temperature below the sensor readings.
I use thermocouple sensor typeK MAX6675.
3x4 keypad
We are the solution

#include <Keypad.h>
#include <Wire.h>
#include <LiquidCrystal.h>
#include <max6675.h>

int relay1 = A0;
int led = 7;

int thermoDO = 4; //bisa juga S0
int thermoCS = 5;
int thermoCLK = 6; //bisa juga SCK

MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
//int vccPin = 3;
//int gndPin = 2;

//RS, E, D4, D5, D6, D7
LiquidCrystal lcd(8, 9, 10, 11, 12, 13);

// make a cute degree symbol
uint8_t degree[8] = {140,146,146,140,128,128,128,128};

void setup() {
pinMode(relay1, OUTPUT);
pinMode(led, OUTPUT);

//Serial.begin(9600);
//use Arduino pins
//pinMode(vccPin, OUTPUT); digitalWrite(vccPin, HIGH);
// pinMode(gndPin, OUTPUT); digitalWrite(gndPin, LOW);

lcd.begin(16, 2);
lcd.createChar(0, degree);

// wait for MAX chip to stabilize
delay(500);
}

void loop() {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("SUHU = ");

int dataku = thermocouple.readCelsius();

lcd.print(thermocouple.readCelsius());

#if ARDUINO >= 100
lcd.write((byte)0);
#else
lcd.print(0, BYTE);
#endif
lcd.print("C ");
delay(1000);

if (thermocouple.readCelsius() >= 60) {
digitalWrite(relay1, HIGH);
}
else {
digitalWrite(relay1, LOW);
}
}

so you want to build a menu system… did you google that?

you could possibly find that some people already had to solve this and were kind enough to share their learnings… surprising isn’t it :slight_smile:

there are many more links available of course.

Same applies with time management.

I would suggest you study those, come up with some code of your own, and if you need help, then post your full code here using the proper formatting </> code brackets

Why is it so complicated to follow the basic rules of this forum and make it easier for people who want to help?

  1. Codes should always be in code tags !!! and
  2. Use (CTRL-T) on Windows or (CMD-T) on Macs to AUTO-format your code so it gets better readable and it gives you hints on missing or superfluous tags.

Such as:

#include <Keypad.h>
#include <Wire.h>
#include <LiquidCrystal.h>
#include <max6675.h>


int relay1 = A0;
int led = 7;

int thermoDO = 4; //bisa juga S0
int thermoCS = 5;
int thermoCLK = 6; //bisa juga SCK

MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
//int vccPin = 3;
//int gndPin = 2;


//RS, E, D4, D5, D6, D7
LiquidCrystal lcd(8, 9, 10, 11, 12, 13);

// make a cute degree symbol
uint8_t degree[8]  = {140, 146, 146, 140, 128, 128, 128, 128};

void setup() {
  pinMode(relay1, OUTPUT);
  pinMode(led, OUTPUT);

  //Serial.begin(9600);
  //use Arduino pins
  //pinMode(vccPin, OUTPUT); digitalWrite(vccPin, HIGH);
  // pinMode(gndPin, OUTPUT); digitalWrite(gndPin, LOW);

  lcd.begin(16, 2);
  lcd.createChar(0, degree);

  // wait for MAX chip to stabilize
  delay(500);
}

void loop() {
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("SUHU = ");

  int dataku = thermocouple.readCelsius();

  lcd.print(thermocouple.readCelsius());

#if ARDUINO >= 100
  lcd.write((byte)0);
#else
  lcd.print(0, BYTE);
#endif
  lcd.print("C ");
  delay(1000);

  if (thermocouple.readCelsius() >= 60) {
    digitalWrite(relay1, HIGH);
  }
  else {
    digitalWrite(relay1, LOW);
  }
}

Sorry
I’m still a beginner.

suhu.ino (1.11 KB)

Yes, I understand;

but then it would be the first action to read the guidance postings which are always on top of the forum categories ...

Could you pls specify, what kind of keypad do you use?
There are quite a lot different ones available, so mightbe you can either post a link to the keypad datasheet or at least post a picture to show, what you will use.