summaryrefslogtreecommitdiff
path: root/eeg.ino
diff options
context:
space:
mode:
Diffstat (limited to 'eeg.ino')
-rw-r--r--eeg.ino3
1 files changed, 2 insertions, 1 deletions
diff --git a/eeg.ino b/eeg.ino
index d129026..d55b91f 100644
--- a/eeg.ino
+++ b/eeg.ino
@@ -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;
}