“(SKU:BRD080049) Tentacle 耳机模块电子积木模块适用于Micro:bit”的版本间的差异

来自YwRobot Studio Wiki
跳转至: 导航搜索
(创建页面,内容为“Tentacle 耳机模块电子积木模块适用于Micro:bit ==产品参数== *名称:Tentacle 耳机...”)
 
样例代码
 
(未显示另一用户的1个中间版本)
第15行: 第15行:
  
 
==使用教程==
 
==使用教程==
[[File:Tentacle_耳机接口转接连主板.jpg|500px|]]
+
[[File:Tentacle_耳机接口转接连主板.jpg|500px|]]<br>
[[File:Tentacle_Tentacle_耳机接口转接连接.jpg|500px|]]
+
[[File:Tentacle_耳机接口转接连接.jpg|500px|]]
 
===样例代码===
 
===样例代码===
 
<pre style="color:blue">
 
<pre style="color:blue">
int ledPin = 9;
+
input.onButtonPressed(Button.A, function () {
int potPin = 2;
+
    music.playTone(262, music.beat(BeatFraction.Whole))
void setup()
+
    music.playTone(262, music.beat(BeatFraction.Whole))
{
+
    music.playTone(392, music.beat(BeatFraction.Whole))
  pinMode(ledPin,OUTPUT);
+
    music.playTone(392, music.beat(BeatFraction.Whole))
  pinMode(potPin,INPUT);
+
    music.playTone(440, music.beat(BeatFraction.Whole))
}
+
    music.playTone(440, music.beat(BeatFraction.Whole))
+
    music.playTone(392, music.beat(BeatFraction.Whole))
void loop(){
+
    basic.pause(500)
  if(digitalRead(potPin)==LOW){
+
    music.playTone(349, music.beat(BeatFraction.Whole))
     digitalWrite(ledPin,HIGH);
+
     music.playTone(349, music.beat(BeatFraction.Whole))
  }
+
    music.playTone(330, music.beat(BeatFraction.Whole))
     if(digitalRead(potPin)==HIGH){
+
     music.playTone(330, music.beat(BeatFraction.Whole))
     digitalWrite(ledPin,LOW);
+
     music.playTone(294, music.beat(BeatFraction.Whole))
     }
+
     music.playTone(294, music.beat(BeatFraction.Whole))
}
+
    music.playTone(262, music.beat(BeatFraction.Whole))
 +
})
 +
 
 
</pre>
 
</pre>
  

2019年10月31日 (四) 16:24的最新版本

Tentacle 耳机模块电子积木模块适用于Micro:bit


产品参数

  • 名称:Tentacle 耳机接口转换模块
  • 尺寸:30*30mm
  • 电压:3-3.3V
  • 输出:模拟量信号
  • 阻值:10K (调节耳机音量大小)
  • 旋转电位器旋转角度:270°
  • 接口:鳄鱼夹接口
  • 音频接口:支持3.5mm接口耳机
  • 平台:Arduino、单片机、ARM、树莓派

使用教程

Tentacle 耳机接口转接连主板.jpg
Tentacle 耳机接口转接连接.jpg

样例代码

input.onButtonPressed(Button.A, function () {
    music.playTone(262, music.beat(BeatFraction.Whole))
    music.playTone(262, music.beat(BeatFraction.Whole))
    music.playTone(392, music.beat(BeatFraction.Whole))
    music.playTone(392, music.beat(BeatFraction.Whole))
    music.playTone(440, music.beat(BeatFraction.Whole))
    music.playTone(440, music.beat(BeatFraction.Whole))
    music.playTone(392, music.beat(BeatFraction.Whole))
    basic.pause(500)
    music.playTone(349, music.beat(BeatFraction.Whole))
    music.playTone(349, music.beat(BeatFraction.Whole))
    music.playTone(330, music.beat(BeatFraction.Whole))
    music.playTone(330, music.beat(BeatFraction.Whole))
    music.playTone(294, music.beat(BeatFraction.Whole))
    music.playTone(294, music.beat(BeatFraction.Whole))
    music.playTone(262, music.beat(BeatFraction.Whole))
})

更多

[YWRobot产品资料下载]

购买 YWRobot商城购买链接