added auxiliary data capability

Esse commit está contido em:
biomurph
2014-12-17 17:14:10 -05:00
commit c0f463c05f
2 arquivos alterados com 17 adições e 1 exclusões
+15 -1
Ver Arquivo
@@ -31,7 +31,12 @@ void OpenBCI_32::startStreaming(){
void OpenBCI_32::sendChannelData(byte sampleNumber){
Serial0.write(sampleNumber); // 1 byte
ADS_writeChannelData(); // 24 bytes
LIS3DH_writeAxisData(); // 6 bytes
if(useAux){
writeAuxData(); // 3 16bit shorts
useAux = false;
}else{
LIS3DH_writeAxisData(); // 3 16bit shorts
}
}
void OpenBCI_32::stopStreaming(){
@@ -80,6 +85,14 @@ void OpenBCI_32::csHigh(int SS)
spi.setMode(DSPI_MODE0); // DEFAULT TO SD MODE!
}
void OpenBCI_32::writeAuxData(){
for(int i=0; i<3; i++){
Serial0.write(highByte(auxData[i])); // write 16 bit axis data MSB first
Serial0.write(lowByte(auxData[i])); // axisData is array of type short (16bit)
auxData[i] = 0; // reset auxData bytes to 0
}
}
// <<<<<<<<<<<<<<<<<<<<<<<<< END OF BOARD WIDE FUNCTIONS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// *************************************************************************************
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ADS1299 FUNCTIONS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ -751,6 +764,7 @@ void OpenBCI_32::LIS3DH_writeAxisData(void){
for(int i=0; i<3; i++){
Serial0.write(highByte(axisData[i])); // write 16 bit axis data MSB first
Serial0.write(lowByte(axisData[i])); // axisData is array of type short (16bit)
axisData[i] = 0; // reset the axis data variables to 0
}
}
+2
Ver Arquivo
@@ -22,6 +22,7 @@ public:
void sendChannelData(byte); // send the current data with sample number
void startStreaming(void); // ADD DAISY USE outputType
void stopStreaming(void); // ADD DAISY USE outputType
void writeAuxData(void);
// ADS1299
void initialize_ads(void);
@@ -74,6 +75,7 @@ public:
boolean useSRB1; // used to keep track of if we are using SRB1
boolean useSRB2[8]; // used to remember if we were included in SRB2 before channel power down
char leadOffSettings[8][2]; // used to control on/off of impedance measure for P and N side of each channel
short auxData[3];
// LIS3DH
short axisData[3];