“Sensor-LED/zh”的版本间的差异

来自Microduino Wikipedia
跳转至: 导航搜索
 
(未显示3个用户的7个中间版本)
第3行: 第3行:
 
|[[File:  Microduino-LED-rect-v1.jpg|300px|left]] ||
 
|[[File:  Microduino-LED-rect-v1.jpg|300px|left]] ||
 
::<p style="color: #000000;font-size:200%"><br><br><br><br><br>'''Sensor-LED'''</p>
 
::<p style="color: #000000;font-size:200%"><br><br><br><br><br>'''Sensor-LED'''</p>
::产品编号:'''<big style="color: #00A0A6">MSDL11</big>'''
+
::产品编号:'''<big style="color: #00A0A6">MSLT63</big>'''
 
|-
 
|-
 
|[[File: Add-to-cart.jpg|300px|left|link=https://shop108263663.taobao.com/?spm=a230r.7195193.1997079397.2.ek3cAW]]||  
 
|[[File: Add-to-cart.jpg|300px|left|link=https://shop108263663.taobao.com/?spm=a230r.7195193.1997079397.2.ek3cAW]]||  
第34行: 第34行:
 
**PIN1:GND
 
**PIN1:GND
 
**PIN2:VCC
 
**PIN2:VCC
**PIN3:数字信号输入
+
**PIN3:数字信号输出
 
**PIN4:NC(空)
 
**PIN4:NC(空)
 
|width="35%" valign="top" align="center"|
 
|width="35%" valign="top" align="center"|
第57行: 第57行:
 
}
 
}
 
void loop() {
 
void loop() {
     digitalWrite(8, HIGH);    //亮灯
+
     digitalWrite(LED , HIGH);    //亮灯
 
     delay(500);
 
     delay(500);
     digitalWrite(8, LOW);  //灭灯
+
     digitalWrite(LED , LOW);  //灭灯
 
     delay(500);
 
     delay(500);
 +
}
 +
</source>
 +
*该例程效果为:调节亮度实现LED灯呼吸效果
 +
**核心Core只能用3,5,6,9,10,11引脚
 +
**核心Core+只能用7,8,9,10,12,13引脚
 +
**核心CoreUSB只能用SCL,3,4,5,6,7,8,9引脚
 +
**核心CoreRF只能用4,5,6,7,8,9,10引脚
 +
<source lang="cpp">
 +
#define LED 3 //定义LED引脚
 +
 +
void setup() {
 +
  pinMode(LED, OUTPUT);
 +
}
 +
void loop() {
 +
  //逐渐变亮
 +
  for (int8_t i = 0; i < 255; i++) {
 +
    analogWrite(LED, i);
 +
    delay(5);
 +
  }
 +
  //逐渐变暗
 +
  for (int8_t i = 255; i > 0; i--) {
 +
    analogWrite(LED, i);
 +
    delay(5);
 +
  }
 
}
 
}
 
</source>
 
</source>
第67行: 第91行:
 
<br>
 
<br>
 
<p style="color: #333333;font-size:135%">'''文档'''</p>
 
<p style="color: #333333;font-size:135%">'''文档'''</p>
*传感器CAD图纸:'''[[File:Sensor_CAD.zip]]'''
+
*
 
<br>
 
<br>
 
----
 
----
第76行: 第100行:
 
<br>
 
<br>
 
<p style="color: #333333;font-size:155%">'''示例教程'''</p>
 
<p style="color: #333333;font-size:155%">'''示例教程'''</p>
[[单色LED灯]]
+
*<big>[[单色LED灯]]</big>
 
<br>
 
<br>
 
----
 
----
第92行: 第116行:
 
|-
 
|-
 
|width="50%" valign="top" align="left"|
 
|width="50%" valign="top" align="left"|
[[file: Microduino-LED-F.JPG|thumb|400px|center|Sensor-PIR Front]]
+
[[file: Microduino-LED-F.JPG|thumb|400px|center|Sensor-LED Front]]
 
|width="50%" valign="top" align="left"|
 
|width="50%" valign="top" align="left"|
[[file: Microduino-LED-b.JPG|thumb|400px|center|Sensor-PIR Back]]
+
[[file: Microduino-LED-b.JPG|thumb|400px|center|Sensor-LED Back]]
 
|}
 
|}
 
|}
 
|}
 +
<p style="font-size:150%">[[MCookie 传感器系列|返回Sensor界面]]</p>
 +
<br>
 +
<br>

2018年12月13日 (四) 10:38的最新版本

Microduino-LED-rect-v1.jpg






Sensor-LED

产品编号:MSLT63
Add-to-cart.jpg

Sensor-LED 直接控制的LED灯,有红、绿、黄三种型号。



技术规格

电压 3.3V~5V
传感器大小 23.5mm*13mm
接口 1.27mm间距的4Pin座
特性描述 分为红、绿、黄三种型号




引脚

  • IN(数字信号)
    • PIN1:GND
    • PIN2:VCC
    • PIN3:数字信号输出
    • PIN4:NC(空)
Sensor backpin.png




编程手册

您可以通过Getting Started了解使用Arduino IDE编程控制模块。

  • 本传感器可连接到核心的以下接口:A0~A7,D2~D13
  • 除核心、电池盒、SensorHub外,还需准备一个LED传感器
  • 使用4pin传感器线连接LED灯与SensorHub扩展板的D8/D9接口
  • 该例程效果为:程序下载成功后,LED灯闪烁
#define LED 8 //定义LED引脚

void setup() {  
  pinMode(LED,OUTPUT);
}
void loop() {
    digitalWrite(LED , HIGH);    //亮灯
    delay(500);
    digitalWrite(LED , LOW);   //灭灯
    delay(500);
}
  • 该例程效果为:调节亮度实现LED灯呼吸效果
    • 核心Core只能用3,5,6,9,10,11引脚
    • 核心Core+只能用7,8,9,10,12,13引脚
    • 核心CoreUSB只能用SCL,3,4,5,6,7,8,9引脚
    • 核心CoreRF只能用4,5,6,7,8,9,10引脚
#define LED 3 //定义LED引脚

void setup() {
  pinMode(LED, OUTPUT);
}
void loop() {
  //逐渐变亮
  for (int8_t i = 0; i < 255; i++) {
    analogWrite(LED, i);
    delay(5);
  }
  //逐渐变暗
  for (int8_t i = 255; i > 0; i--) {
    analogWrite(LED, i);
    delay(5);
  }
}




文档




注意事项




示例教程




Q&A




历史




图库

Sensor-LED Front
Sensor-LED Back

返回Sensor界面