Skip to content

Commit

Permalink
Merge pull request #145 from OpenBCI/144-focus-tutorial-issue
Browse files Browse the repository at this point in the history
Update Arduino Focus firmware files
  • Loading branch information
retiutut authored Jan 30, 2023
2 parents a788739 + 4bdfd67 commit 57952ba
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// //
// - The Arduino Built-In LED blinks when the user is Focused //
// https://docs.openbci.com/Tutorials/17-Arduino_Focus_Example.md //
// Tested 4/7/2019 using iMac, Genuine Arduino, OpenBCI_GUI 4.1.2 //
// Tested 1/30/2023 using iMac, Genuine Arduino, OpenBCI_GUI 5.1.0 //
////////////////////////////////////////////////////////////////////////

const byte numChars = 32;
Expand Down Expand Up @@ -53,10 +53,10 @@ void showNewData() {
//Only perform an action when the incoming data changes
if (!s.equals(previousData)) {
//Check if the string is "true" or "false"
if (s.equals("false")) {
if (s.equals("0")) {
Serial.println("Input: FALSE");
digitalWrite(LED_BUILTIN, LOW);
} else if (s.equals("true")) {
} else if (s.equals("1")) {
Serial.println("Input: TRUE");
digitalWrite(LED_BUILTIN, HIGH);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// - Potentiometer controls motor speed //
// - Button on pin 7 reverses motor direction while pressed //
// //
// Tested 7/27/2019 using iMac, Genuine Arduino, OpenBCI_GUI 4.1.3 //
// Tested 1/30/2023 using iMac, Genuine Arduino, OpenBCI_GUI 5.1.0 //
// Uses https://learn.adafruit.com/adafruit-arduino-lesson-15-dc-motor-reversing/ //
// and https://docs.openbci.com/Tutorials/17-Arduino_Focus_Example //
/////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -77,11 +77,11 @@ void showNewData() {
//Only perform an action when the incoming data changes
if (!s.equals(previousData)) {
//Check if the string is "true" or "false"
if (s.equals("false")) {
if (s.equals("0")) {
Serial.println("Input: FALSE");
isFocused = false;
digitalWrite(LED_BUILTIN, LOW);
} else if (s.equals("true")) {
} else if (s.equals("1")) {
Serial.println("Input: TRUE");
digitalWrite(LED_BUILTIN, HIGH);
isFocused = true;
Expand Down
6 changes: 3 additions & 3 deletions OpenBCI_files/OpenBCI_GUI-FocusFan/OpenBCI_GUI-FocusFan.ino
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// - The Arduino Built-In LED blinks when the user is Focused //
// - A button on pin 7 toggles motor speed: Full, Medium, Low, and Off //
// //
// Tested 7/29/2019 using iMac, Genuine Arduino, OpenBCI_GUI 4.1.3 //
// Tested 1/30/2023 using iMac, Arduino Pro Mini, OpenBCI_GUI 5.1.0 //
// Uses https://learn.adafruit.com/adafruit-arduino-lesson-15-dc-motor-reversing/ //
// and https://docs.openbci.com/Tutorials/17-Arduino_Focus_Example //
/////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -82,11 +82,11 @@ void showNewData() {
//Only perform an action when the incoming data changes
if (!s.equals(previousData)) {
//Check if the string is "true" or "false"
if (s.equals("false")) {
if (s.equals("0")) {
Serial.println("Input: FALSE");
isFocused = false;
digitalWrite(LED_BUILTIN, LOW);
} else if (s.equals("true")) {
} else if (s.equals("1")) {
Serial.println("Input: TRUE");
digitalWrite(LED_BUILTIN, HIGH);
isFocused = true;
Expand Down

0 comments on commit 57952ba

Please sign in to comment.