From 93c44cf3e60fa707f0caa10cdbc353ad195cae7c Mon Sep 17 00:00:00 2001 From: kitschpatrol Date: Sat, 18 Jan 2014 00:05:13 -0500 Subject: [PATCH] Formatting clean up, back to simpler boolean update() return value. --- Brain/Brain.cpp | 552 +++++++++--------- Brain/Brain.h | 131 ++--- Brain/examples/BrainBlinker/BrainBlinker.ino | 64 +- .../BrainSerialTest/BrainSerialTest.ino | 26 +- .../BrainSoftSerialTest.ino | 2 +- 5 files changed, 375 insertions(+), 400 deletions(-) diff --git a/Brain/Brain.cpp b/Brain/Brain.cpp index 589d1ca..7f02757 100644 --- a/Brain/Brain.cpp +++ b/Brain/Brain.cpp @@ -2,198 +2,174 @@ #include "Brain.h" Brain::Brain(Stream &_brainStream) { - brainStream = &_brainStream; - - // Keep the rest of the initialization process in a separate method in case - // we overload the constructor. - init(); + brainStream = &_brainStream; + + // Keep the rest of the initialization process in a separate method in case + // we overload the constructor. + init(); } void Brain::init() { - // TODO: Shouldn't this be 57600 for the TGAM and other fast modules ?? - //brainStream->begin(9600); - - freshPacket = false; - inPacket = false; - packetIndex = 0; - packetLength = 0; - checksum = 0; - checksumAccumulator = 0; - eegPowerLength = 0; - hasPower = false; - - signalQuality = 200; - attention = 0; - meditation = 0; - - clearEegPower(); + // It's up to the calling code to start the stream + // Usually Serial.begin(9600); + freshPacket = false; + inPacket = false; + packetIndex = 0; + packetLength = 0; + checksum = 0; + checksumAccumulator = 0; + eegPowerLength = 0; + hasPower = false; + + signalQuality = 200; + attention = 0; + meditation = 0; + + clearEegPower(); } -uint8_t Brain::update() { - uint8_t parse_return; - if (brainStream->available()) { - latestByte = brainStream->read(); - - // Build a packet if we know we're and not just listening for sync bytes. - if (inPacket) { - - // First byte after the sync bytes is the length of the upcoming packet. - if (packetIndex == 0) { - packetLength = latestByte; - - // Catch error if packet is too long - if (packetLength > MAX_PACKET_LENGTH) { - // Packet exceeded max length - // Send an error - sprintf(latestError, "ERROR: Packet too long"); - inPacket = false; - } - } - else if (packetIndex <= packetLength) { - // Run of the mill data bytes. - - // Print them here - - // Store the byte in an array for parsing later. - packetData[packetIndex - 1] = latestByte; - - // Keep building the checksum. - checksumAccumulator += latestByte; - } - else if (packetIndex > packetLength) { - // We're at the end of the data payload. - - // Check the checksum. - checksum = latestByte; - checksumAccumulator = 255 - checksumAccumulator; - - // Do they match? - if (checksum == checksumAccumulator) { - - // Parse the data. parsePacker() returns true if parsing succeeds. - parse_return = parsePacket(); - if (parse_return > 0x0) { - freshPacket = true; - } - else { - // Parsing failed, send an error. - sprintf(latestError, "ERROR: Could not parse"); - // good place to print the packet if debugging - } - } - else { - // Checksum mismatch, send an error. - sprintf(latestError, "ERROR: Checksum"); - // good place to print the packet if debugging - } - // End of packet - - // Reset, prep for next packet - inPacket = false; - } - - packetIndex++; - } - - // Look for the start of the packet - if ((latestByte == 170) && (lastByte == 170) && !inPacket) { - // Start of packet - inPacket = true; - packetIndex = 0; - packetLength = 0; // Technically not necessarry. - checksum = 0; // Technically not necessary. - checksumAccumulator = 0; - //clearPacket(); // Zeros the packet array, technically not necessarry. - //clearEegPower(); // Zeros the EEG power. Necessary if hasPower turns false... better off on the gettter end? - } - - // Keep track of the last byte so we can find the sync byte pairs. - lastByte = latestByte; - } - - if (freshPacket) { - freshPacket = false; - return true; - } - else { - return false; - } - +boolean Brain::update() { + if (brainStream->available()) { + latestByte = brainStream->read(); + + // Build a packet if we know we're and not just listening for sync bytes. + if (inPacket) { + + // First byte after the sync bytes is the length of the upcoming packet. + if (packetIndex == 0) { + packetLength = latestByte; + + // Catch error if packet is too long + if (packetLength > MAX_PACKET_LENGTH) { + // Packet exceeded max length + // Send an error + sprintf(latestError, "ERROR: Packet too long"); + inPacket = false; + } + } + else if (packetIndex <= packetLength) { + // Run of the mill data bytes. + + // Print them here + + // Store the byte in an array for parsing later. + packetData[packetIndex - 1] = latestByte; + + // Keep building the checksum. + checksumAccumulator += latestByte; + } + else if (packetIndex > packetLength) { + // We're at the end of the data payload. + + // Check the checksum. + checksum = latestByte; + checksumAccumulator = 255 - checksumAccumulator; + + // Do they match? + if (checksum == checksumAccumulator) { + boolean parseSuccess = parsePacket(); + + if (parseSuccess) { + freshPacket = true; + } + else { + // Parsing failed, send an error. + sprintf(latestError, "ERROR: Could not parse"); + // good place to print the packet if debugging + } + } + else { + // Checksum mismatch, send an error. + sprintf(latestError, "ERROR: Checksum"); + // good place to print the packet if debugging + } + // End of packet + + // Reset, prep for next packet + inPacket = false; + } + + packetIndex++; + } + + // Look for the start of the packet + if ((latestByte == 170) && (lastByte == 170) && !inPacket) { + // Start of packet + inPacket = true; + packetIndex = 0; + packetLength = 0; // Technically not necessarry. + checksum = 0; // Technically not necessary. + checksumAccumulator = 0; + } + + // Keep track of the last byte so we can find the sync byte pairs. + lastByte = latestByte; + } + + if (freshPacket) { + freshPacket = false; + return true; + } + else { + return false; + } + } void Brain::clearPacket() { - for (uint8_t i = 0; i < MAX_PACKET_LENGTH; i++) { - packetData[i] = 0; - } + for (uint8_t i = 0; i < MAX_PACKET_LENGTH; i++) { + packetData[i] = 0; + } } void Brain::clearEegPower() { - // Zero the power bands. - for(uint8_t i = 0; i < EEG_POWER_BANDS; i++) { - eegPower[i] = 0; - } + // Zero the power bands. + for(uint8_t i = 0; i < EEG_POWER_BANDS; i++) { + eegPower[i] = 0; + } } -/** - * Returns a bitmask indicating what packets did we get - * - * 1st bit signalQuality - * 2nd bit attention - * 3rd bit meditation - * 4th bit power bands - * 5th bit raw value - */ -uint8_t Brain::parsePacket() { - // Loop through the packet, extracting data. - // Based on mindset_communications_protocol.pdf from the Neurosky Mindset SDK. - hasPower = false; - clearEegPower(); // clear the eeg power to make sure we're honest about missing values... null would be better than 0. - uint8_t return_byte = B00000000; - - for (uint8_t i = 0; i < packetLength; i++) { - switch (packetData[i]) { - case 2: //0x2 - signalQuality = packetData[++i]; - return_byte = return_byte | B00000001; - break; - case 4: // 0x4 - attention = packetData[++i]; - return_byte = return_byte | B00000010; - break; - case 5: // 0x5 - meditation = packetData[++i]; - return_byte = return_byte | B00000100; - break; - case 131: // 0x83 - // ASIC_EEG_POWER: eight big-endian 3-uint8_t unsigned integer values representing delta, theta, low-alpha high-alpha, low-beta, high-beta, low-gamma, and mid-gamma EEG band power values - // The next uint8_t sets the length, usually 24 (Eight 24-bit numbers... big endian?) - /** - * We dont' use this value so let's skip it and just increment i - eegPowerLength = packetData[++i]; - */ - i++; - - // Extract the values. Possible memory savings here by creating three temp longs? - for(int j = 0; j < EEG_POWER_BANDS; j++) { - eegPower[j] = ((uint32_t)packetData[++i] << 16) | ((uint32_t)packetData[++i] << 8) | (uint32_t)packetData[++i]; - } - - hasPower = true; - // This seems to happen once during start-up on the force trainer. Strange. Wise to wait a couple of packets before - // you start reading. - return_byte = return_byte | B00001000; - - break; +boolean Brain::parsePacket() { + // Loop through the packet, extracting data. + // Based on mindset_communications_protocol.pdf from the Neurosky Mindset SDK. + // Returns true if passing succeeds + hasPower = false; + boolean parseSuccess = true; + clearEegPower(); // clear the eeg power to make sure we're honest about missing values + + for (uint8_t i = 0; i < packetLength; i++) { + switch (packetData[i]) { + case 0x2: + signalQuality = packetData[++i]; + break; + case 0x4: + attention = packetData[++i]; + break; + case 0x5: + meditation = packetData[++i]; + break; + case 0x83: + // ASIC_EEG_POWER: eight big-endian 3-uint8_t unsigned integer values representing delta, theta, low-alpha high-alpha, low-beta, high-beta, low-gamma, and mid-gamma EEG band power values + // The next uint8_t sets the length, usually 24 (Eight 24-bit numbers... big endian?) + // We dont' use this value so let's skip it and just increment i + i++; + + // Extract the values + for (int j = 0; j < EEG_POWER_BANDS; j++) { + eegPower[j] = ((uint32_t)packetData[++i] << 16) | ((uint32_t)packetData[++i] << 8) | (uint32_t)packetData[++i]; + } + + hasPower = true; + // This seems to happen once during start-up on the force trainer. Strange. Wise to wait a couple of packets before + // you start reading. + break; case 0x80: - /** - * We dont' use this value so let's skip it and just increment i - uint8_t rawLength = packetData[++i]; - */ - i++; - rawValue = ((int)packetData[++i] << 8) | packetData[++i]; - return_byte = return_byte | B00010000; + // We dont' use this value so let's skip it and just increment i + // uint8_t packetLength = packetData[++i]; + i++; + int checksum = ((int)packetData[++i] << 8) | packetData[++i]; break; - default: + default: // Broken packet ? /* Serial.print(F("parsePacket UNMATCHED data 0x")); @@ -202,169 +178,169 @@ uint8_t Brain::parsePacket() { Serial.print(i, DEC); printPacket(); */ - return 0x0; - break; - } - } - return return_byte; + parseSuccess = false; + break; + } + } + return parseSuccess; } -// DEPRECATED, sticking around for debug use +// Keeping this around for debug use void Brain::printCSV() { - // Print the CSV over serial - brainStream->print(signalQuality, DEC); - brainStream->print(","); - brainStream->print(attention, DEC); - brainStream->print(","); - brainStream->print(meditation, DEC); - - if (hasPower) { - for(int i = 0; i < EEG_POWER_BANDS; i++) { - brainStream->print(","); - brainStream->print(eegPower[i], DEC); - } - } + // Print the CSV over serial + brainStream->print(signalQuality, DEC); + brainStream->print(","); + brainStream->print(attention, DEC); + brainStream->print(","); + brainStream->print(meditation, DEC); + + if (hasPower) { + for(int i = 0; i < EEG_POWER_BANDS; i++) { + brainStream->print(","); + brainStream->print(eegPower[i], DEC); + } + } - brainStream->println(""); + brainStream->println(""); } char* Brain::readErrors() { - return latestError; + return latestError; } char* Brain::readCSV() { - // spit out a big string? - // find out how big this really needs to be - // should be popped off the stack once it goes out of scope? - // make the character array as small as possible - - if(hasPower) { - - sprintf(csvBuffer,"%d,%d,%d,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu", - signalQuality, - attention, - meditation, - eegPower[0], - eegPower[1], - eegPower[2], - eegPower[3], - eegPower[4], - eegPower[5], - eegPower[6], - eegPower[7] - ); - - return csvBuffer; - } - else { - sprintf(csvBuffer,"%d,%d,%d", - signalQuality, - attention, - meditation - ); - - return csvBuffer; - } + // spit out a big string? + // find out how big this really needs to be + // should be popped off the stack once it goes out of scope? + // make the character array as small as possible + + if(hasPower) { + + sprintf(csvBuffer,"%d,%d,%d,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu", + signalQuality, + attention, + meditation, + eegPower[0], + eegPower[1], + eegPower[2], + eegPower[3], + eegPower[4], + eegPower[5], + eegPower[6], + eegPower[7] + ); + + return csvBuffer; + } + else { + sprintf(csvBuffer,"%d,%d,%d", + signalQuality, + attention, + meditation + ); + + return csvBuffer; + } } // For debugging, print the entire contents of the packet data array. void Brain::printPacket() { - brainStream->print("["); - for (uint8_t i = 0; i < MAX_PACKET_LENGTH; i++) { - brainStream->print(packetData[i], DEC); + brainStream->print("["); + for (uint8_t i = 0; i < MAX_PACKET_LENGTH; i++) { + brainStream->print(packetData[i], DEC); - if (i < MAX_PACKET_LENGTH - 1) { - brainStream->print(", "); - } - } - brainStream->println("]"); + if (i < MAX_PACKET_LENGTH - 1) { + brainStream->print(", "); + } + } + brainStream->println("]"); } void Brain::printDebug() { - brainStream->println(""); - brainStream->println("--- Start Packet ---"); - brainStream->print("Signal Quality: "); - brainStream->println(signalQuality, DEC); - brainStream->print("Attention: "); - brainStream->println(attention, DEC); - brainStream->print("Meditation: "); - brainStream->println(meditation, DEC); - - if (hasPower) { - brainStream->println(""); - brainStream->println("EEG POWER:"); - brainStream->print("Delta: "); - brainStream->println(eegPower[0], DEC); - brainStream->print("Theta: "); - brainStream->println(eegPower[1], DEC); - brainStream->print("Low Alpha: "); - brainStream->println(eegPower[2], DEC); - brainStream->print("High Alpha: "); - brainStream->println(eegPower[3], DEC); - brainStream->print("Low Beta: "); - brainStream->println(eegPower[4], DEC); - brainStream->print("High Beta: "); - brainStream->println(eegPower[5], DEC); - brainStream->print("Low Gamma: "); - brainStream->println(eegPower[6], DEC); - brainStream->print("Mid Gamma: "); - brainStream->println(eegPower[7], DEC); - } - - brainStream->println(""); - brainStream->print("Checksum Calculated: "); - brainStream->println(checksumAccumulator, DEC); - brainStream->print("Checksum Expected: "); - brainStream->println(checksum, DEC); - - brainStream->println("--- End Packet ---"); - brainStream->println(""); + brainStream->println(""); + brainStream->println("--- Start Packet ---"); + brainStream->print("Signal Quality: "); + brainStream->println(signalQuality, DEC); + brainStream->print("Attention: "); + brainStream->println(attention, DEC); + brainStream->print("Meditation: "); + brainStream->println(meditation, DEC); + + if (hasPower) { + brainStream->println(""); + brainStream->println("EEG POWER:"); + brainStream->print("Delta: "); + brainStream->println(eegPower[0], DEC); + brainStream->print("Theta: "); + brainStream->println(eegPower[1], DEC); + brainStream->print("Low Alpha: "); + brainStream->println(eegPower[2], DEC); + brainStream->print("High Alpha: "); + brainStream->println(eegPower[3], DEC); + brainStream->print("Low Beta: "); + brainStream->println(eegPower[4], DEC); + brainStream->print("High Beta: "); + brainStream->println(eegPower[5], DEC); + brainStream->print("Low Gamma: "); + brainStream->println(eegPower[6], DEC); + brainStream->print("Mid Gamma: "); + brainStream->println(eegPower[7], DEC); + } + + brainStream->println(""); + brainStream->print("Checksum Calculated: "); + brainStream->println(checksumAccumulator, DEC); + brainStream->print("Checksum Expected: "); + brainStream->println(checksum, DEC); + + brainStream->println("--- End Packet ---"); + brainStream->println(""); } uint8_t Brain::readSignalQuality() { - return signalQuality; + return signalQuality; } uint8_t Brain::readAttention() { - return attention; + return attention; } uint8_t Brain::readMeditation() { - return meditation; + return meditation; } uint32_t* Brain::readPowerArray() { - return eegPower; + return eegPower; } uint32_t Brain::readDelta() { - return eegPower[0]; + return eegPower[0]; } uint32_t Brain::readTheta() { - return eegPower[1]; + return eegPower[1]; } uint32_t Brain::readLowAlpha() { - return eegPower[2]; + return eegPower[2]; } uint32_t Brain::readHighAlpha() { - return eegPower[3]; + return eegPower[3]; } uint32_t Brain::readLowBeta() { - return eegPower[4]; + return eegPower[4]; } uint32_t Brain::readHighBeta() { - return eegPower[5]; + return eegPower[5]; } uint32_t Brain::readLowGamma() { - return eegPower[6]; + return eegPower[6]; } uint32_t Brain::readMidGamma() { - return eegPower[7]; + return eegPower[7]; } diff --git a/Brain/Brain.h b/Brain/Brain.h index 425a993..cb8d83e 100644 --- a/Brain/Brain.h +++ b/Brain/Brain.h @@ -6,80 +6,77 @@ #define MAX_PACKET_LENGTH 32 #define EEG_POWER_BANDS 8 -// TK some kind of reset timer if we don't receive a packet for >3 seconds? - class Brain { - public: - Brain(Stream &_brainStream); + public: + Brain(Stream &_brainStream); - // Run this in the main loop. - uint8_t update(); + // Run this in the main loop. + boolean update(); - // String with most recent error. - char* readErrors(); + // String with most recent error. + char* readErrors(); - // Returns comme-delimited string of all available brain data. - // Sequence is as below. - char* readCSV(); + // Returns comme-delimited string of all available brain data. + // Sequence is as below. + char* readCSV(); - // Individual pieces of brain data. - uint8_t readSignalQuality(); - uint8_t readAttention(); - uint8_t readMeditation(); - uint32_t* readPowerArray(); - uint32_t readDelta(); - uint32_t readTheta(); - uint32_t readLowAlpha(); - uint32_t readHighAlpha(); - uint32_t readLowBeta(); - uint32_t readHighBeta(); - uint32_t readLowGamma(); - uint32_t readMidGamma(); - int rawValue; - - private: - Stream* brainStream; - uint8_t packetData[MAX_PACKET_LENGTH]; - boolean inPacket; - uint8_t latestByte; - uint8_t lastByte; - uint8_t packetIndex; - uint8_t packetLength; - uint8_t checksum; - uint8_t checksumAccumulator; - uint8_t eegPowerLength; - boolean hasPower; - void clearPacket(); - void clearEegPower(); - boolean parsePacket(); - - void printPacket(); - void init(); - void printCSV(); // maybe should be public? - void printDebug(); + // Individual pieces of brain data. + uint8_t readSignalQuality(); + uint8_t readAttention(); + uint8_t readMeditation(); + uint32_t* readPowerArray(); + uint32_t readDelta(); + uint32_t readTheta(); + uint32_t readLowAlpha(); + uint32_t readHighAlpha(); + uint32_t readLowBeta(); + uint32_t readHighBeta(); + uint32_t readLowGamma(); + uint32_t readMidGamma(); + + private: + Stream* brainStream; + uint8_t packetData[MAX_PACKET_LENGTH]; + boolean inPacket; + uint8_t latestByte; + uint8_t lastByte; + uint8_t packetIndex; + uint8_t packetLength; + uint8_t checksum; + uint8_t checksumAccumulator; + uint8_t eegPowerLength; + boolean hasPower; + void clearPacket(); + void clearEegPower(); + boolean parsePacket(); + + void printPacket(); + void init(); + void printCSV(); // maybe should be public? + void printDebug(); - // With current hardware, at most we would have... - // 3 x 3 char uint8_ts - // 8 x 10 char ulongs - // 10 x 1 char commas - // 1 x 1 char 0 (string termination) - // ------------------------- - // 100 characters - char csvBuffer[100]; - - // Longest error is - // 22 x 1 char uint8_ts - // 1 x 1 char 0 (string termination) - char latestError[23]; - - uint8_t signalQuality; - uint8_t attention; - uint8_t meditation; + // With current hardware, at most we would have... + // 3 x 3 char uint8_t + // 8 x 10 char uint32_t + // 10 x 1 char commas + // 1 x 1 char 0 (string termination) + // ------------------------- + // 100 characters + char csvBuffer[100]; + + // Longest error is + // 22 x 1 char uint8_ts + // 1 x 1 char 0 (string termination) + char latestError[23]; + + uint8_t signalQuality; + uint8_t attention; + uint8_t meditation; - boolean freshPacket; - - // Lighter to just make this public, instead of using the getter? - uint32_t eegPower[EEG_POWER_BANDS]; + boolean freshPacket; + + // Lighter to just make this public, instead of using the getter? + uint32_t eegPower[EEG_POWER_BANDS]; }; #endif diff --git a/Brain/examples/BrainBlinker/BrainBlinker.ino b/Brain/examples/BrainBlinker/BrainBlinker.ino index a742053..1944c76 100644 --- a/Brain/examples/BrainBlinker/BrainBlinker.ino +++ b/Brain/examples/BrainBlinker/BrainBlinker.ino @@ -16,42 +16,42 @@ long previousMillis = 0; int ledState = LOW; void setup() { - // Set up the LED pin. - pinMode(ledPin, OUTPUT); - - // Start the hardware serial. - Serial.begin(9600); + // Set up the LED pin. + pinMode(ledPin, OUTPUT); + + // Start the hardware serial. + Serial.begin(9600); } void loop() { - // Expect packets about once per second. - if (brain.update()) { - Serial.println(brain.readCSV()); - - // Attention runs from 0 to 100. - interval = (100 - brain.readAttention()) * 10; - } - - // Make sure we have a signal. - if(brain.readSignalQuality() == 0) { - - // Blink the LED. - if (millis() - previousMillis > interval) { - // Save the last time you blinked the LED. - previousMillis = millis(); + // Expect packets about once per second. + if (brain.update()) { + Serial.println(brain.readCSV()); + + // Attention runs from 0 to 100. + interval = (100 - brain.readAttention()) * 10; + } + + // Make sure we have a signal. + if(brain.readSignalQuality() == 0) { + + // Blink the LED. + if (millis() - previousMillis > interval) { + // Save the last time you blinked the LED. + previousMillis = millis(); - // If the LED is off turn it on and vice-versa: - if (ledState == LOW) - ledState = HIGH; - else - ledState = LOW; + // If the LED is off turn it on and vice-versa: + if (ledState == LOW) + ledState = HIGH; + else + ledState = LOW; - // Set the LED with the ledState of the variable: - digitalWrite(ledPin, ledState); - } - } - else { + // Set the LED with the ledState of the variable: + digitalWrite(ledPin, ledState); + } + } + else { digitalWrite(ledPin, LOW); - } - + } + } diff --git a/Brain/examples/BrainSerialTest/BrainSerialTest.ino b/Brain/examples/BrainSerialTest/BrainSerialTest.ino index d520550..accc78d 100644 --- a/Brain/examples/BrainSerialTest/BrainSerialTest.ino +++ b/Brain/examples/BrainSerialTest/BrainSerialTest.ino @@ -1,6 +1,8 @@ -// Arduino Brain Library -// Serial out example, grabs the brain data and sends CSV out over the hardware serial. -// Eric Mika, 2010 +// Arduino Brain Library - Brain Serial Test + +// Description: Grabs brain data from the serial RX pin and sends CSV out over the TX pin (Half duplex.) +// More info: https://github.com/kitschpatrol/Arduino-Brain-Library +// Author: Eric Mika, 2010 revised in 2014 #include @@ -8,16 +10,16 @@ Brain brain(Serial); void setup() { - // Start the hardware serial. - Serial.begin(9600); + // Start the hardware serial. + Serial.begin(9600); } void loop() { - // Expect packets about once per second. - // The .readCSV() function returns a string (well, char*) listing the most recent brain data, in the following format: - // "signal strength, attention, meditation, delta, theta, low alpha, high alpha, low beta, high beta, low gamma, high gamma" - if (brain.update()) { - Serial.println(brain.readErrors()); - Serial.println(brain.readCSV()); - } + // Expect packets about once per second. + // The .readCSV() function returns a string (well, char*) listing the most recent brain data, in the following format: + // "signal strength, attention, meditation, delta, theta, low alpha, high alpha, low beta, high beta, low gamma, high gamma" + if (brain.update()) { + Serial.println(brain.readErrors()); + Serial.println(brain.readCSV()); + } } diff --git a/Brain/examples/BrainSoftSerialTest/BrainSoftSerialTest.ino b/Brain/examples/BrainSoftSerialTest/BrainSoftSerialTest.ino index affa511..7df6c79 100644 --- a/Brain/examples/BrainSoftSerialTest/BrainSoftSerialTest.ino +++ b/Brain/examples/BrainSoftSerialTest/BrainSoftSerialTest.ino @@ -24,7 +24,7 @@ void setup() { void loop() { // Expect packets about once per second. // The .readCSV() function returns a string (well, char*) listing the most recent brain data, in the following format: - // "signal strength, attention, meditation, delta, theta, low alpha, high alpha, low beta, high beta, low gamma, high gamma" + // "signal strength, attention, meditation, delta, theta, low alpha, high alpha, low beta, high beta, low gamma, high gamma" if (brain.update()) { Serial.println(brain.readErrors()); Serial.println(brain.readCSV());