登录
首页 » c » PIC8单片机ADC应用

PIC8单片机ADC应用

于 2022-01-25 发布 文件大小:2.45 kB
0 72
下载积分: 2 下载次数: 1

代码说明:

#include volatile unsigned char adresult; void ADC_Sample(unsigned char adch); void DelayXms(unsigned char x); #define _DEBUG //调试程序用 /********************************************************** 函数名称:AD_Sample 函数功能:AD检测 入口参数:adch - 检测通道 出口参数:无  备    注:采样通道需自行设置为模拟口      采样10次,取中间八次的平均值为采样结果存于adresult中 **********************************************************/ void ADC_Sample(unsigned char adch) { static unsigned int adsum = 0; static unsigned char admin = 0,admax = 0; static unsigned char adtimes = 0; ADCON1 = 0; //左对齐 ADCON0 = 0X41 | (adch

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • AIS-Simulator
    this is test version for ais simulator.
    2021-03-15 16:59:23下载
    积分:1
  • asp.net发送邮件
    asp.net发送邮件
    2015-03-05下载
    积分:1
  • usbdisk
    u盘制作资料(原理图、文档、底层驱动源程序)_(u disk production of information (drawings, documents, the bottom-driven source) _)
    2020-10-30 18:49:56下载
    积分:1
  • 682630343power_wind_dfig_det
    建立包含直驱型风力发电机、单级式光伏发电系统和储能蓄电池的风能与光伏混合微电网模型。混合微电网在并网运行时,通过储能蓄电池平滑风能和光伏电源的输出功率波动,维持公共连接点电压。A wind power and photovoltaic hybrid microgrid model including direct drive wind turbine, single-stage photovoltaic power generation system and energy storage battery is established. When the hybrid microgrid is connected to the grid, it can maintain the voltage of the common connection point by fluctuating the output power of the energy storage battery smoothing wind energy and the photovoltaic power.(A wind power and photovoltaic hybrid microgrid model including direct drive wind turbine, single-stage photovoltaic power generation system and energy storage battery is established. When the hybrid microgrid is connected to the grid, it can maintain the voltage of the common connection point by fluctuating the output power of the energy storage battery smoothing wind energy and the photovoltaic power.)
    2021-04-17 19:38:52下载
    积分:1
  • .NET 后台管理系统(源码+数据库)
    【实例简介】 .NET 通用后台角色权限管理系统 软件架构 通用三层架构,面向接口编程。 技术选型 MVC5 Mysql Dapper Autofac Layui 阿里巴巴矢量库
    2021-07-04 00:31:14下载
    积分:1
  • 基于机器学习以及Halcon的页码分类系统(C#)
    这是一个基于机器学习的halcon页码分类程序,它不仅可以用于分类书本页码,其实任何需要分类的东西的可以用这套代码,主要是训练量要够,检测时是双重检测,先检测轮廓,成功了再检测里面的东西。然后这个压缩包里面包括了C#代码以及Halcon源代码,注释完整,大家想要的就下载吧。
    2023-02-18 14:30:10下载
    积分:1
  • VC#.NET范例入门与提高
    VC#.NET范例入门与提高-VC#.NET paradigm and improve entry
    2022-01-26 00:47:36下载
    积分:1
  • 英文阅读器,在visual studio 2002平台下运行。导入英文文本格式就可以实现阅读。...
    英文阅读器,在visual studio 2002平台下运行。导入英文文本格式就可以实现阅读。-English readers, visual studio 2002 platforms. Into English text format can be achieved reading.
    2022-02-26 15:06:34下载
    积分:1
  • brick
    有限元n维实体材料单元,仅供科研用途,拒绝商业使用(N-dimensional finite element solid material element, for scientific purposes, refusing commercial use)
    2013-10-23 14:32:13下载
    积分:1
  • MPU6050与卡尔曼滤波算法实践(MPU6050sketch01.ino)
    #include "Wire.h"#include "I2Cdev.h"#include "MPU6050.h" MPU6050 accelgyro; unsigned long now, lastTime = 0;float dt;                                   //微分时间 int16_t ax, ay, az, gx, gy, gz;             //加速度计陀螺仪原始数据float aax=0, aay=0,aaz=0, agx=0, agy=0, agz=0;    //角度变量long axo = 0, ayo = 0, azo = 0;             //加速度计偏移量long gxo = 0, gyo = 0, gzo = 0;             //陀螺仪偏移量 float pi = 3.1415926;float AcceRatio = 16384.0;                  //加速度计比例系数float GyroRatio = 131.0;                    //陀螺仪比例系数 uint8_t n_sample = 8;                       //加速度计滤波算法采样个数float aaxs[8] = {0}, aays[8] = {0}, aazs[8] = {0};         //x,y轴采样队列long aax_sum, aay_sum,aaz_sum;                      //x,y轴采样和 float a_x[10]={0}, a_y[10]={0},a_z[10]={0} ,g_x[10]={0} ,g_y[10]={0},g_z[10]={0}; //加速度计协方差计算队列float Px=1, Rx, Kx, Sx, Vx, Qx;             //x轴卡尔曼变量float Py=1, Ry, Ky, Sy, Vy, Qy;             //y轴卡尔曼变量float Pz=1, Rz, Kz, Sz, Vz, Qz;             //z轴卡尔曼变量 void setup(){    Wire.begin();    Serial.begin(115200);     accelgyro.initialize();                 //初始化     unsigned short times = 200;             //采样次数    for(int i=0;i
    2019-12-11下载
    积分:1
  • 696518资源总数
  • 105578会员总数
  • 20今日下载