diff options
-rw-r--r-- | eeg.ino | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -54,6 +54,7 @@ class Keepon { callback display_callback; + // these two functions need to be loop-friendly! no while, no delay void take_control() { digitalWrite(SDA, LOW); digitalWrite(SCL, LOW); @@ -65,7 +66,6 @@ class Keepon { TWBR = ((F_CPU / MK_FREQ) - 16) / 2; } - void check_connection() { if (analogRead(0) > 512) return; take_control(); @@ -80,6 +80,7 @@ class Keepon { digitalWrite(SCL, LOW); } bool update() { + check_connection(); if (queue.empty()) return false; return true; } |