没有合适的资源?快使用搜索试试~ 我知道了~
Arduino项目开发 Sensors_Ping_Ping.pdf
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 169 浏览量
2022-07-06
18:39:26
上传
评论
收藏 3KB PDF 举报
温馨提示
试读
2页
Arduino项目开发 Sensors_Ping_Ping.pdf 学习资料 复习资料 教学资源
资源推荐
资源详情
资源评论
/* Ping))) Sensor
This sketch reads a PING))) ultrasonic rangefinder and returns the
distance to the closest object in range. To do this, it sends a pulse
to the sensor to initiate a reading, then listens for a pulse
to return. The length of the returning pulse is proportional to
the distance of the object from the sensor.
The circuit:
* +V connection of the PING))) attached to +5V
* GND connection of the PING))) attached to ground
* SIG connection of the PING))) attached to digital pin 7
http://www.arduino.cc/en/Tutorial/Ping
created 3 Nov 2008
by David A. Mellis
modified 30 Aug 2011
by Tom Igoe
This example code is in the public domain.
*/
// this constant won't change. It's the pin number
// of the sensor's output:
const int pingPin = 7;
void setup() {
// initialize serial communication:
Serial.begin(9600);
}
void loop() {
// establish variables for duration of the ping,
// and the distance result in inches and centimeters:
long duration, inches, cm;
// The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
// Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
pinMode(pingPin, OUTPUT);
digitalWrite(pingPin, LOW);
资源评论
努力搬砖的小王
- 粉丝: 29
- 资源: 7706
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Tableau实训一-教育网站指标评估
- 基于Python爬虫+词云图+情感分析对某东上完美日记的用户评论分析(数据集+代码).rar
- 古诗105-听琴听琴听琴听琴听琴听琴听琴听琴听琴听琴听琴听琴听琴听琴听琴听琴听琴
- 一个普通的SpringCloud样例
- PSE-PCN考试题库该题库答案为真实选项,另外选项为额外插入,非原题选项
- 数据挖掘实战-基于KMeans算法对超市客户进行聚类分群(数据集+代码).rar
- css网页设计.pdf
- 数据分析案例-顾客购物数据可视化分析(数据集+代码).rar
- 19613fc3f7378acf2787f12bbf7a34a1.JPG
- mmexport1718846385059.jpg
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功