STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
simple.cpp
Go to the documentation of this file.
1// #include <ADS126X.h>
2// #include <SPI.h>
3// #include <Arduino.h>
4// #include "board_pins.h"
5// #include "adcs.h"
6
7// void setup() {
8// Serial.begin(230400);
9// SPI.begin(SCLK, MISOp, MOSIp, CS);
10
11// if (!adcs::init()) { while (1) { delay(1000); } }
12// if (!adcs::configure()){ while (1) { delay(1000); } }
13// }
14
15// void loop() {
16// const uint8_t channel = 7;
17// auto result = adcs::read(channel);
18
19// if (result.ok) {
20// Serial.print("Channel: "); Serial.println(channel);
21// Serial.print("Raw value: "); Serial.println(result.raw);
22// Serial.print("Sample time (us): "); Serial.println(result.sample_time);
23// Serial.print("Read duration (us): ");
24// Serial.println(result.read_time_dur); Serial.print("Conversion time (us):
25// "); Serial.println(result.conv_time_dur);
26// Serial.println("-------------");
27// } else {
28// Serial.println("ADC read failed or timed out.");
29// }
30
31// delay(500); // half second delay between reads
32// }