Created
June 25, 2014 20:30
-
-
Save snegovick/94f2078f26ce1c8987e8 to your computer and use it in GitHub Desktop.
AD8495 ADC values to degrees celsium macros
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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