From 4ce311a5a9dcc843f113007f2ab034fb4b70c985 Mon Sep 17 00:00:00 2001 From: Muhammad Izza Alfiansyah Date: Tue, 9 Jul 2024 16:16:41 +0700 Subject: [PATCH] fixed variable buzzer when turning on --- microcontroller/sketch_apr22a/sketch_apr22a.ino | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/microcontroller/sketch_apr22a/sketch_apr22a.ino b/microcontroller/sketch_apr22a/sketch_apr22a.ino index 0b1408f..f4be02f 100644 --- a/microcontroller/sketch_apr22a/sketch_apr22a.ino +++ b/microcontroller/sketch_apr22a/sketch_apr22a.ino @@ -670,13 +670,12 @@ void insertHistory(bool berhasil = true) { String json = JSON.stringify(req); - JSONVar sett; - req["buzzer_on"] = true; + JSONVar reqSet; + reqSet["buzzer_on"] = false; - String jsonSett = JSON.stringify(sett); + String jsonReqSet = JSON.stringify(reqSet); - db.insert("histori_fermentasi", json, false); - db.from("pengaturan").eq("id", "1").doUpdate(jsonSett); + db.from("pengaturan").eq("id", "1").doUpdate(jsonReqSet); callUser(berhasil); pengujian = true;