Skip to content

Instantly share code, notes, and snippets.

@snegovick snegovick/ad8495.h
Created Jun 25, 2014

Embed
What would you like to do?
AD8495 ADC values to degrees celsium macros
#ifndef __AD8495_H__
#define __AD8495_H__
/* Adjust these values*/
#define VREF 3300 /* Vref input 3.3V */
#define RES_ADC (1<<12) /* ADC resolution 1<<12 stands for 12bit */
/* These values should be ok without tuning */
#define RES_MV 5 /* 5mv / Deg. Celsium */
#define SCALE 100 /* dont use floats, just scale */
#define RES_MEASUREMENT ((VREF*SCALE)/RES_ADC)
#define ADC_TO_DEG(adc_value) (((adc_value*RES_MEASUREMENT)/RES_MV)/SCALE)
#endif/*__AD8495_H__*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.