2015-07-10 06:01:56 -07:00
|
|
|
/*
|
|
|
|
* @file adc_external.h
|
|
|
|
*
|
2017-11-24 14:40:20 -08:00
|
|
|
* external ADC is probably broken, at least there is a major mess
|
2015-07-10 06:01:56 -07:00
|
|
|
*
|
|
|
|
* @date Aug 18, 2013
|
2020-01-13 18:57:43 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
|
2020-02-18 05:16:19 -08:00
|
|
|
#pragma once
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
#include "mcp3208.h"
|
|
|
|
|
|
|
|
#define getAdcValue(channel) getMcp3208adc(channel)
|
2021-01-05 13:02:20 -08:00
|
|
|
#define adcToVoltsDivided(adc) (5.0f / 4095 * (adc))
|
2023-01-08 14:29:29 -08:00
|
|
|
#define getVoltageDivided(msg, channel) (isAdcChannelValid(channel) ? adcToVoltsDivided(getAdcValue(msg, channel), channel) : 66.66)
|