Skip to content
Snippets Groups Projects
Commit e80fa66a authored by Pascal Engeler's avatar Pascal Engeler
Browse files

Added reset upon setup, made reset more robust

parent de393ebd
No related branches found
No related tags found
No related merge requests found
......@@ -40,10 +40,9 @@
void reset_comm(){
uint8_t buf[8] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
SPI.beginTransaction(SPISettings(SPIRATE, MSBFIRST, SPI_MODE3));
for(unsigned i = 0; i < 8; ++i){
SPI.transfer(0xFF);
}
SPI.transfer(buf, 8);
SPI.endTransaction();
}
......@@ -134,6 +133,8 @@ void setup() {
delay(1000);
digitalWrite(nCS, LOW);
reset_comm();
delay(500);
setup_adc();
digitalWrite(nCS, HIGH);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment