 #include <DSPI.h>
 
-int packetSendIntervalMs = 50; // 50 ms
+int packetSendIntervalMs = 500; // 50 ms
 unsigned long lastPacketSent = millis();
 const int packetSize = 32;
 uint8_t buf[packetSize];
-uint8_t WIFI_SS = 18;
+uint8_t WIFI_SS = 13;
 
 DSPI0 spi;  // use DSPI library
 
 boolean streaming = false;
+boolean wifi = false;
 
 void setup() {
 

  pinMode(WIFI_SS,OUTPUT); digitalWrite(WIFI_SS,HIGH);

  spi.begin();
  spi.setSpeed(20000000);  // use 4MHz for ADS and LIS3DH
  spi.setMode(DSPI_MODE0);  // default to SD card mode!

  Serial0.begin(115200);

void flushbufToSpi() {
  uint8_t i = 0;
  uint8_t len = packetSize;
  if (wifi) digitalWrite(WIFI_SS,LOW);
  spi.transfer(0x02);
  spi.transfer(0x00);
  while(i < packetSize) {
      spi.transfer('a');
      i++;
  }
  if (wifi) digitalWrite(WIFI_SS,HIGH);
}
