コード例 #1
0
ファイル: temp.c プロジェクト: MisterUser/MPLAB_projects
/***********************************************************************
Function: 	calc_Vout
Parameters:	none
returns:	none
overview: 	Calculates a voltage level based off of the ADC result
************************************************************************/
void calc_Vout(void)
{

	//Using a 5Vdd and the ADC in 12-bit mode, gives us a 3.3/4096 = around 806uV/step
	Vout = ReadADC1(0)*0.0008056640625;

}
コード例 #2
0
ファイル: main.c プロジェクト: Olvar-ag/RESET
int main(void)
{
    GPIOInit();
    ADCInit();
  while(1)
  {
    value = ReadADC1(1) * 0.0822 * 2.54;
  }
}