3 changed files with 44 additions and 31 deletions
@ -0,0 +1,24 @@ |
|||
/*
|
|||
* test.cpp |
|||
* |
|||
* Created on: Aug 23, 2017 |
|||
* Author: Elmar |
|||
*/ |
|||
|
|||
#include <SmingCore/HardwareSerial.h> |
|||
#include "tests.h" |
|||
|
|||
void SettingsTest(rijnfel::ads::cADS101x * ads1015) { |
|||
for (int channel = 0; channel < 4; channel++) { |
|||
ads1015->SetMux(static_cast<rijnfel::ads::eInputMux>(rijnfel::ads::eInputMux::AIN_0 + channel)); |
|||
Serial.printf("Settings: %d\n\r", ads1015->GetSettings()); |
|||
} |
|||
} |
|||
|
|||
void AdcTest(rijnfel::ads::cADS101x * ads1015) { |
|||
for (int channel = 0; channel < 4; channel++) { |
|||
ads1015->SetMux(static_cast<rijnfel::ads::eInputMux>(rijnfel::ads::eInputMux::AIN_0 + channel)); |
|||
rijnfel::ads::ads_sample_t sample = ads1015->RawSample(); |
|||
Serial.printf("converted: %d channel: %d\n\r", ads1015->ConvertSample(sample), sample.mux); |
|||
} |
|||
} |
@ -0,0 +1,17 @@ |
|||
/*
|
|||
* tests.h |
|||
* |
|||
* Created on: Aug 23, 2017 |
|||
* Author: Elmar |
|||
*/ |
|||
|
|||
#ifndef APP_TESTS_H_ |
|||
#define APP_TESTS_H_ |
|||
|
|||
#include "ads101x.h" |
|||
#include "dac101c085.h" |
|||
|
|||
void SettingsTest(rijnfel::ads::cADS101x ads1015); |
|||
void AdcTest(rijnfel::ads::cADS101x * ads1015); |
|||
|
|||
#endif /* APP_TESTS_H_ */ |
Loading…
Reference in new issue