为了能到远方,脚下的每一步都不能少.|

Blue Mountain

园龄:10年7个月粉丝:572关注:0

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输出

本文作者:Blue Mountain

本文链接:https://www.cnblogs.com/BlueMountain-HaggenDazs/p/6056472.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   Blue Mountain  阅读(1168)  评论(0编辑  收藏  举报
历史上的今天:
2015-11-12 通信原理实践(五)——2PSK 与2DPSK 通信系统
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起
  1. 1 404 not found REOL
404 not found - REOL
00:00 / 00:00
An audio error has occurred.