Advertisement

[TM4C123单片机实战] 两路ADC检测,短路报警

阅读量:

当所获取的最终数据表现为两条数据路径之间的差异时,可选择启用ADC的差分工作模式进行处理。

复制代码
 #include <stdbool.h>

    
 #include <stdint.h>
    
 #include "inc/hw_memmap.h"
    
 #include "driverlib/adc.h"
    
 #include "driverlib/gpio.h"
    
 #include "driverlib/pin_map.h"
    
 #include "driverlib/sysctl.h"
    
 #include "user/LCDDriver.h"
    
  
    
 #define abs(x) (((x)<0)? -(x):(x))
    
  
    
 uint32_t pui32ADC0Value[1]={0};
    
 //这是我们的数据缓存, ADC采样数据存储在这里
    
    
    
    
复制代码
  
    
 void adcConfig(){
    
 	SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC1);
    
 	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
    

全部评论 (0)

还没有任何评论哟~