OpenBCI / OpenBCI_Cyton_Library

Repository for OpenBCI Cyton Arduino Libraries
MIT License
88 stars 89 forks source link

ADD: Variable Sample_Rate #26

Closed yj-xxxiii closed 7 years ago

yj-xxxiii commented 8 years ago

Full code from : https://github.com/yj-xxxiii/OpenBCI_2kHz

case waiting_freq_value : if('1' <= testChar && testChar <='4') { Sample_Rate_SD_Only = 0b110-(testChar-'1'); if(EEPROM.read(2)!=Sample_Rate_SD_Only) EEPROM.write(2 , (uint8_t)Sample_Rate_SD_Only); Serial0.println(250<<(0b110-Sample_Rate_SD_Only)); } command_state = waiting_command_beginning ; break ; ... ... case 'N': writeToSDonly = true; OBCI.Sample_Rate = Sample_Rate_SD_Only ; ... In OpenBCI_32_Daisy.cpp WREG(CONFIG1,0xB0+Sample_Rate,BOARD_ADS); // tell on-board ADS to output its clk, set the data rate to Sample_Rate WREG(CONFIG1,0x90+Sample_Rate,BOARD_ADS); // turn off clk output if no daisy present I am still unable to paste the code properly formatted... y.j.

andrewjaykeller commented 8 years ago

Just saw another person interested in this. Will be looking to do this soon!

echoGee commented 8 years ago

+1 .. I'd like to measure at 4khz , but 2khz would be good!

andrewjaykeller commented 8 years ago

Thanks for the code @yj-xxxiii looking at it now. Was having trouble with setting on the fly but your code should help me lots!

andrewjaykeller commented 8 years ago

This will be addressed in 3.0.0.

andrewjaykeller commented 7 years ago

Check out the new release! https://github.com/OpenBCI/OpenBCI_32bit_Library/releases/tag/v3.0.0-beta1 for full wifi support