From 0cbb6bde782062f4cb6527fe917647c703775c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20St=C3=A4ck?= Date: Wed, 16 Oct 2019 15:30:49 +0200 Subject: [PATCH] Explicitly initialize variables, use "bool-specific" values when setting. --- NuEVI/NuEVI.ino | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/NuEVI/NuEVI.ino b/NuEVI/NuEVI.ino index 5934dc6..ef82a2a 100644 --- a/NuEVI/NuEVI.ino +++ b/NuEVI/NuEVI.ino @@ -1051,8 +1051,8 @@ void doorKnobCheck() { //*********************************************************** void extraController() { - bool CC2sw; - bool CC1sw; + bool CC2sw = false; + bool CC1sw = false; int extracCC; // Extra Controller is the lip touch sensor (proportional) in front of the mouthpiece exSensor = exSensor * 0.6 + 0.4 * touchRead(extraPin); // get sensor data, do some smoothing - SENSOR PIN 16 - PCB PIN "EC" (marked K4 on some prototype boards) @@ -1072,17 +1072,17 @@ void extraController() { } else if (pinkySetting == ECSW){ if (pinkyKey){ //send extra controller CC2 only - CC2sw = 1; - CC1sw = 0; + CC2sw = true; + CC1sw = false; } else { //send extra controller primary CC only - CC2sw = 0; - CC1sw = 1; + CC2sw = false; + CC1sw = true; } } else { //send both primary CC and CC2 - CC2sw = 1; - CC1sw = 1; + CC2sw = true; + CC1sw = true; } if ((extraCT || extraCT2) && (exSensor >= extracThrVal)) { // if we are enabled and over the threshold, send data if (!extracIsOn) {