aboutsummaryrefslogtreecommitdiff
path: root/vote
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2025-04-16 11:39:50 +0200
committerJonas Smedegaard <dr@jones.dk>2025-04-16 11:39:50 +0200
commitd2964a112211084c03e90f69001565997ed26152 (patch)
tree68bd3402d5ba695cf9bbb8c207da46124f9342b8 /vote
parentd6a944ecce92f1b5bdd54aaf3ed57808c3286ce0 (diff)
replace functions debug() and printStack() with plot-friendly output
Diffstat (limited to 'vote')
-rw-r--r--vote/vote.ino22
1 files changed, 6 insertions, 16 deletions
diff --git a/vote/vote.ino b/vote/vote.ino
index 44fd179..cc17e79 100644
--- a/vote/vote.ino
+++ b/vote/vote.ino
@@ -41,10 +41,6 @@ struct Vote {
int measure;
};
-void begin();
-String desc();
-int read();
-String debug();
bool push(String id, unsigned long timestamp, int measure);
void printStack();
bool qualifyVote(Vote vote, unsigned long currentTime);
@@ -137,17 +133,6 @@ bool qualifyVote(Vote vote, unsigned long currentTime) {
return false;
}
-/// Dump internal variables, formatted for use with Serial Plotter
-///
-/// @return internal variables as String
-String debug() {
- return static_cast<String>(
- "pin:") + _pin
- + "\tboolState:" + _boolState
- + "\ttime:" + _time
- + "\tcount:" + _count;
-}
-
void setup() {
// enable logging to serial
Serial.begin(115200);
@@ -164,10 +149,15 @@ void setup() {
}
void loop() {
+
BLEScanResults *foundDevices = pBLEScan->start(scanTime, false);
pBLEScan->clearResults();
- printStack();
+ // misuse error-only log level for plot-friendly output
+#if ARDUHAL_LOG_LEVEL == ARDUHAL_LOG_LEVEL_ERROR
+ Serial.printf("pin:%d boolState:%d time:%d count:%d\n",
+ _pin, _boolState, _time, _count);
+#endif
delay(500);
}