差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 | ||
wm_wiki:light_sensor:manual [2020/02/20 16:34] juneral [3.1 编程指南] |
wm_wiki:light_sensor:manual [2020/02/20 17:44] (当前版本) juneral [1. 简要概述] |
||
---|---|---|---|
行 1: | 行 1: | ||
====== 光线传感器 ====== | ====== 光线传感器 ====== | ||
- | ===== 1、简要概述 ===== | + | ===== 1. 简要概述 ===== |
<html><body> | <html><body> | ||
<p class=MsoTitle align=left style='text-align:left;text-indent:36.0pt'><span | <p class=MsoTitle align=left style='text-align:left;text-indent:36.0pt'><span | ||
style='font-size:16.0pt;font-family:宋体;color:#222222;letter-spacing:0pt; | style='font-size:16.0pt;font-family:宋体;color:#222222;letter-spacing:0pt; | ||
- | background:white'>光线传感器(<span lang=EN-US>Light Sensor</span>)是基于半导体的光电效应原理做成的传感器,其可以对传感器周围环境的光强度进行检测,将光的强弱转换为电信号,传输给主控。</span></p> | + | background:white'>光线传感器(<span lang=EN-US>Light Sensor</span>)是基于半导体的光电效应原理做成的传感器(将光信号转换为电信号),其可以对传感器周围环境的光强度进行检测,将光的强弱转换为电信号,传输给主控。</span></p> |
</body></html> | </body></html> | ||
- | ===== 2、参数规格 ===== | + | ===== 2. 参数规格 ===== |
<html><body> | <html><body> | ||
<div align=center> | <div align=center> | ||
行 113: | 行 113: | ||
</div> | </div> | ||
</body></html> | </body></html> | ||
- | ===== 3、编程指南 ===== | + | ===== 3. 编程指南 ===== |
==== 3.1. 模块功能及图形化编程指南 ==== | ==== 3.1. 模块功能及图形化编程指南 ==== | ||
<html><body> | <html><body> | ||
行 173: | 行 173: | ||
</body></html> | </body></html> | ||
+ | {{ :wm_wiki:light_sensor:pasted:20200220-163919.png }} | ||
+ | |||
+ | ==== 3.2. 文本代码编程指南 ==== | ||
+ | |||
+ | <html><body> | ||
+ | <p class=MsoNormal style='text-indent:21.0pt'><span style='font-size:16.0pt; | ||
+ | font-family:华文楷体'> </span><span lang=ZH-CN style='font-size:16.0pt; | ||
+ | font-family:宋体'>Arduino编程示例:</span></p> | ||
+ | |||
+ | </body></html> | ||
+ | |||
+ | <sxh cpp; first-line: 1;highlight: [89,92]; title: light_sensor_test.ino> | ||
+ | |||
+ | #include<WeELF328P.h> | ||
+ | |||
+ | We7SegmentDisplay seven_segment_A(PORT_A); | ||
+ | uint16_t value = 0; | ||
+ | |||
+ | void setup(){ | ||
+ | pinMode(PORT_1, INPUT); | ||
+ | } | ||
+ | |||
+ | void loop(){ | ||
+ | value = analogRead(PORT_1); | ||
+ | seven_segment_A.showNumber(value); | ||
+ | delay(100); | ||
+ | } | ||
+ | | ||
+ | </sxh> | ||
+ | |||
+ | \\ | ||
+ | <html><body> | ||
+ | <p class=MsoNormal style='text-indent:21.0pt'><span style='font-size:16.0pt; | ||
+ | font-family:华文楷体'> </span><span lang=ZH-CN style='font-size:16.0pt; | ||
+ | font-family:宋体'>更多使用实例请前往论坛学习:光线传感器使用实例(建设中)</span></p> | ||
+ | |||
+ | </body></html> |