From d79581a1e124e2d7287c2070f0492b7ab3f9cbde Mon Sep 17 00:00:00 2001 From: Daniel Hirscher Date: Thu, 26 Nov 2020 16:25:17 +0100 Subject: [PATCH] added upper L for Arduino Uno to preheating time The literals for the preheating time are interpreted as int. On Arduino Uno an int is 2 bytes in size, ranging from -32,768 to 32,767. Therefore, the calculated number of 3*60*1000=180000 does not fit in. Added upper L to force the literal to long. --- MHZ.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MHZ.cpp b/MHZ.cpp index 4de8b42..7c01714 100644 --- a/MHZ.cpp +++ b/MHZ.cpp @@ -8,8 +8,8 @@ const int MHZ14A = 14; const int MHZ19B = 19; -const unsigned long MHZ14A_PREHEATING_TIME = 3 * 60 * 1000; -const unsigned long MHZ19B_PREHEATING_TIME = 3 * 60 * 1000; +const unsigned long MHZ14A_PREHEATING_TIME = 3L * 60L * 1000L; +const unsigned long MHZ19B_PREHEATING_TIME = 3L * 60L * 1000L; const unsigned long MHZ14A_RESPONSE_TIME = 60 * 1000; const unsigned long MHZ19B_RESPONSE_TIME = 120 * 1000;