void ADS1299::printDeviceID(void) { boolean wasRunning; boolean prevverbosityState = verbosity; if (isRunning){ stopADS(); wasRunning = true;} verbosity = true; getDeviceID(); verbosity = prevverbosityState; if (wasRunning){ startADS(); } }
//print out the state of all the control registers void ADS1299::printAllRegisters(void) { boolean wasRunning = false; boolean prevverbosityState = verbosity; if (isRunning){ stopADS(); wasRunning = true; } verbosity = true; // set up for verbosity output RREGS(0x00,0x17); // read out the first registers // delay(10); // stall to let all that data get read by the PC // RREGS(0x11,0x17-0x11); // read out the rest verbosity = prevverbosityState; if (wasRunning){ startADS(); } }
void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer clockSetup(); portInit(); initializeB0I2C(); // int myConfig = ADS_OS | ADS_PGA_2 | ADS_128Hz | ADS_ALERT_NO | ADS_CONV1; int myConfig = ADS_PGA_2 | ADS_475Hz | ADS_ALERT_NO | ADS_CONVC; myADC = registerADS(ADS_01, ADS_DEFAULTC); // myADC = registerADS(ADS_01,ADS_DEFAULTC); setADS(myADC); _enable_interrupts(); startADS(); while (1) { a = readADS(); } }