首页 > 其他 > 详细

Arduino101学习笔记(五)—— 模拟IO

时间:2016-11-12 13:45:18      阅读:159      评论:0      收藏:0      [点我收藏+]

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

Arduino101学习笔记(五)—— 模拟IO

原文:http://www.cnblogs.com/BlueMountain-HaggenDazs/p/6056472.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!