zoukankan      html  css  js  c++  java
  • Arduino101学习笔记(五)—— 模拟IO

    1、配置IO管脚

    //*********************************************************************************************
    //函数名称:void analogReference (uint8_t type);
    //输入参数:type: DEFAULT : 默认5V
    //                               INTERNAL: 低功耗模式
    //                               EXTERNAL: 扩展模式. 通过AREF引脚获取参考电压
    //函数返回:无
    //函数功能:模拟IO配置
    //*********************************************************************************************
    void analogReference (uint8_t type);

    2、读取模拟IO管脚
    //*********************************************************************************************
    //函数名称:int analogRead (uint8_t pin);
    //输入参数:pin: 0 ~ 5
    //函数返回:0~1023
    //函数功能:模拟IO读取
    //*********************************************************************************************
    int analogRead (uint8_t pin);

    3、写模拟IO管脚

    //*********************************************************************************************
    //函数名称:void analogWrite (uint8_t pin, int value) ;
    //输入参数:pin: 0 ~ 5    value  0~ 256
    //函数返回:无
    //函数功能:模拟IO写
    //*********************************************************************************************
    void analogWrite (uint8_t pin, int value) ;

        使用数字PWM(频率1KHz一下)来模拟DAC输出

  • 相关阅读:
    python+opencv 运行环境搭建
    centos 安装 FLEXPART
    centos 安装npm node
    USACO4.3 Street Race【分析】
    USACO4.3 Letter Game【枚举·细节】
    结构体封装高精度 大整数BigInt
    POJ3585 Accumulation Degree【换根dp】
    换根dp特征总结
    HDU2196 Computer【换根dp】
    CF1187E Tree Painting【换根dp】
  • 原文地址:https://www.cnblogs.com/BlueMountain-HaggenDazs/p/6056472.html
Copyright © 2011-2022 走看看