6 for(
int i = 0; i < avg_num; i++){
12 return (uint16_t)(total_data / avg_num);
44 digitalWrite(
cs_pin, HIGH);
Header file for the Max1148 library for Dartmouth's 317 Lab. Manages ADC communication through SPI.
void csh()
Sets the chip select pin to high.
void csl()
Sets the chip select pin to low.
uint16_t adc_read()
Reads a single ADC value from the Max1148 ADC. Used in adc_read_avg.
uint8_t channel
Channel for the ADC. Selected in the constructor.
int cs_pin
Chip select pin for the ADC.
uint16_t adc_read_avg(int avg_number)
Reads an average ADC value from the Max1148 ADC. Uses Arduino's SPI library. We don't use this anymor...