Flipklok
 
Loading...
Searching...
No Matches
adc.h
Go to the documentation of this file.
1/*
2 * adc.h
3 *
4 * Created on: 21 mrt. 2025
5 */
6
7#ifndef ADC_H_
8#define ADC_H_
9#include <msp430.h>
10
11void setupAdc();
12void startAdcConv();
13double convertAdc2Voltage(int R1, int R2, int adcReading);
14
15#define NUM_CHANNELS 3
16#define referenceVoltage 2.5
17#define adcMax 1023
18
19volatile unsigned int adcResults[NUM_CHANNELS];
20
21
22
23#endif /* ADC_H_ */
void startAdcConv()
Start the ADC conversion'(s), gets called when end interrupt of ISR_TA0(void) is reached.
Definition adc.c:119
double convertAdc2Voltage(int R1, int R2, int adcReading)
Convert the adc reading to a voltage before voltage divider.
Definition adc.c:132
volatile unsigned int adcResults[NUM_CHANNELS]
Definition adc.h:19
#define NUM_CHANNELS
Definition adc.h:15
void setupAdc()
Setup ADC, get called in startup from main(), Shortest samling rate, with 2.5V reference,...
Definition adc.c:86