“(SKU:ELB060415)3路MOS管场效应管驱动模块 IRF540”的版本间的差异
来自YwRobot Studio Wiki
YWrobot WM(讨论 | 贡献) |
(→样例代码) |
||
第25行: | 第25行: | ||
[[File:3MOS1LINE.jpg|1050px|]] | [[File:3MOS1LINE.jpg|1050px|]] | ||
− | === | + | ===样例代码1=== |
<pre style="color:blue"> | <pre style="color:blue"> | ||
+ | int led1 = 9; | ||
+ | int led2 = 10; | ||
+ | int led3 = 11; | ||
+ | void setup() { | ||
+ | pinMode(led1, OUTPUT); | ||
+ | pinMode(led2, OUTPUT); | ||
+ | pinMode(led3, OUTPUT); | ||
+ | } | ||
+ | |||
+ | void loop() { | ||
+ | digitalWrite(led1, HIGH); | ||
+ | delay(1000); | ||
+ | digitalWrite(led1, LOW); | ||
+ | digitalWrite(led2, HIGH); | ||
+ | delay(1000); | ||
+ | digitalWrite(led2, LOW); | ||
+ | digitalWrite(led3, HIGH); | ||
+ | delay(1000); | ||
+ | digitalWrite(led3, LOW); | ||
+ | } | ||
+ | </pre> | ||
+ | |||
+ | ===样例代码2=== | ||
+ | <pre style="color:blue"> | ||
+ | int led1 = 9; | ||
+ | int led2 = 10; | ||
+ | int led3 = 11; | ||
+ | |||
+ | void setup() { | ||
+ | pinMode(led1, OUTPUT); | ||
+ | pinMode(led2, OUTPUT); | ||
+ | pinMode(led3, OUTPUT); | ||
+ | } | ||
+ | |||
+ | void loop() { | ||
+ | digitalWrite(led1, HIGH); | ||
+ | delay(1000); | ||
+ | digitalWrite(led1, LOW); | ||
+ | digitalWrite(led2, HIGH); | ||
+ | delay(1000); | ||
+ | digitalWrite(led2, LOW); | ||
+ | digitalWrite(led3, HIGH); | ||
+ | delay(1000); | ||
+ | digitalWrite(led3, LOW); | ||
+ | } | ||
</pre> | </pre> | ||
2017年1月11日 (三) 16:07的版本
简介
采用原装IRF540功率MOS管,可以进行PWM调节输出 可以让Arduino驱动高达24V的负载,如LED灯带、直流马达、微型水泵、电磁阀 用过PWM调可以实现LED无级调光、马达无级调速。
注意:驱动1A以上的负载需安装散热片
产品参数
- 尺寸:69.4*41.7mm
- 固定孔:3mm
- 孔距:2400*1300mil(60.96*33.02mm)
- 电压:3.3V、5V
- 端口:数字量电平
- 输出负载电压:0-24V
- 输出负载电流:<6A (1A以上需加散热片)
- 平台:Arduino、单片机、ARM、树莓派
使用教程
样例代码1
int led1 = 9; int led2 = 10; int led3 = 11; void setup() { pinMode(led1, OUTPUT); pinMode(led2, OUTPUT); pinMode(led3, OUTPUT); } void loop() { digitalWrite(led1, HIGH); delay(1000); digitalWrite(led1, LOW); digitalWrite(led2, HIGH); delay(1000); digitalWrite(led2, LOW); digitalWrite(led3, HIGH); delay(1000); digitalWrite(led3, LOW); }
样例代码2
int led1 = 9; int led2 = 10; int led3 = 11; void setup() { pinMode(led1, OUTPUT); pinMode(led2, OUTPUT); pinMode(led3, OUTPUT); } void loop() { digitalWrite(led1, HIGH); delay(1000); digitalWrite(led1, LOW); digitalWrite(led2, HIGH); delay(1000); digitalWrite(led2, LOW); digitalWrite(led3, HIGH); delay(1000); digitalWrite(led3, LOW); }
更多
[YWRobot产品资料下载]