代码拉取完成,页面将自动刷新
/**************************************************************************/
/*!
@file io.cpp
@author lisper (lisper.li@dfrobot.com)
@license LGPLv3 (see license.txt)
provide some useful function make it easy to control io
Copyright (C) 2014 DFRobot
*/
#include <Arduino.h>
#include "io.h"
digitalOut::digitalOut (uint8_t thePin) {
pin = thePin;
pinMode (thePin, OUTPUT);
}
void digitalOut:: write (uint8_t value) {
digitalWrite (pin, value);
}
digitalIn::digitalIn (uint8_t thePin) {
pin = thePin;
pinMode (pin, INPUT);
}
uint8_t digitalIn::read () {
return digitalRead (pin);
}
analogOut::analogOut (uint8_t thePin) {
pin = thePin;
pinMode (pin, OUTPUT);
}
void analogOut::write (uint8_t value) {
analogWrite (pin, value);
}
analogIn::analogIn (uint8_t thePin) {
pin = thePin;
pinMode (pin, INPUT);
}
uint16_t analogIn::read () {
return analogRead (pin);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。