37 lines
519 B
C++
37 lines
519 B
C++
#include "Arduino.h"
|
|
|
|
#include "Streaming.h"
|
|
#include "Metro.h"
|
|
|
|
#include "ads1210.h"
|
|
#include "led.h"
|
|
|
|
|
|
const uint8_t LED_PIN = 8;
|
|
const uint8_t ADC_CS_PIN = 9;
|
|
const uint8_t ADC_RDY_PIN = 7;
|
|
|
|
|
|
ADS1210 ads1210;
|
|
LED led;
|
|
Metro secondTick = Metro(1000);
|
|
|
|
|
|
void setup() {
|
|
Serial.begin(9600);
|
|
delay(1000);
|
|
|
|
led(LED_PIN);
|
|
ads1210.begin(ADC_CS_PIN, ADC_RDY_PIN);
|
|
}
|
|
|
|
void loop() {
|
|
ads1210.exec();
|
|
|
|
if (secondTick.check() == 1) {
|
|
led.toggle();
|
|
|
|
Serial << "AdcValue: " << adc1210.value << endl;
|
|
}
|
|
}
|