Skip to content

Commit 65249b9

Browse files
committed
add sound tutorial 1 and 2
1 parent 661b0b6 commit 65249b9

7 files changed

Lines changed: 255 additions & 2 deletions

File tree

index-tutorials.html

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ <h4><a href="./?lang=zh-hant&page=tutorials/button-3" target="_blank">點擊按
160160
( <a href="./?lang=zh-hant&page=tutorials/button-3#-JvWuaeLK-rrGi66lVIM" target="_blank">解答</a> )
161161
</li>
162162
<li>
163-
<h4><a href="./?lang=zh-hant&page=tutorials/button-4" target="_blank">點擊按鈕開關完賽跑小遊戲</a></h4>
163+
<h4><a href="./?lang=zh-hant&page=tutorials/button-4" target="_blank">點擊按鈕開關玩賽跑小遊戲</a></h4>
164164
( <a href="./?lang=zh-hant&page=tutorials/button-4#-JvY90I0qUoJR2yi34lj" target="_blank">解答</a> )
165165
</li>
166166
</ul>
@@ -180,7 +180,7 @@ <h4><a href="./?lang=zh-hant&page=tutorials/dht-2" target="_blank">偵測溫濕
180180
<h3>人體紅外線偵測</h3>
181181
<ul>
182182
<li>
183-
<h4><a href="./?lang=zh-hant&page=tutorials/pir-1" target="_blank">偵測人體紅外線</a></h4>
183+
<h4><a href="./?lang=zh-hant&page=tutorials/pir-1" target="_blank">偵測人體紅外線改變圖片</a></h4>
184184
( <a href="./?lang=zh-hant&page=tutorials/pir-1#-JvxRwAXj4ccyigeuI8o" target="_blank">解答</a> )
185185
</li>
186186
<li>
@@ -189,6 +189,18 @@ <h4><a href="./?lang=zh-hant&page=tutorials/pir-2" target="_blank">偵測人體
189189
</li>
190190
</ul>
191191
<br/>
192+
<h3>聲音偵測</h3>
193+
<ul>
194+
<li>
195+
<h4><a href="./?lang=zh-hant&page=tutorials/sound-1" target="_blank">偵測聲音改變圖片</a></h4>
196+
( <a href="./?lang=zh-hant&page=tutorials/sound-1#-JvxeaQ60xcOYLuXKCke" target="_blank">解答</a> )
197+
</li>
198+
<li>
199+
<h4><a href="./?lang=zh-hant&page=tutorials/sound-2" target="_blank">偵測聲音並點亮 LED 燈</a></h4>
200+
( <a href="./?lang=zh-hant&page=tutorials/sound-2#-JvxfZT00ZuWL1NvSh6n" target="_blank">解答</a> )
201+
</li>
202+
</ul>
203+
<br/>
192204
<script>
193205
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
194206
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

msg/tutorials/sound-1/en.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
MSG.backIndex = "Webduino Blockly Tutorials";
2+
MSG.demoTitle = "Blockly Demo Area";
3+
MSG.catTutorials = "Tutorials";
4+
5+
MSG.subTitle = "Chapter 6-1 : Sound detect";
6+
MSG.demoDescription = "If it detects sound, let the bulb light";

msg/tutorials/sound-1/zh-hant.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
MSG.backIndex = "Webduino 積木教學";
2+
MSG.demoTitle = "Blockly 範例測試區";
3+
MSG.catTutorials = "教學積木";
4+
5+
MSG.subTitle = "課程 7-1:偵測聲音";
6+
MSG.demoDescription = "偵測到聲音,就讓圖片的燈泡發亮";

msg/tutorials/sound-2/en.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
MSG.backIndex = "Webduino Blockly Tutorials";
2+
MSG.demoTitle = "Blockly Demo Area";
3+
MSG.catTutorials = "Tutorials";
4+
5+
MSG.subTitle = "Chapter 6-1 : Sound detect and light LED";
6+
MSG.demoDescription = "If it detects sound, let the bulb and LED light";

msg/tutorials/sound-2/zh-hant.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
MSG.backIndex = "Webduino 積木教學";
2+
MSG.demoTitle = "Blockly 範例測試區";
3+
MSG.catTutorials = "教學積木";
4+
5+
MSG.subTitle = "課程 7-2:偵測聲音點亮 LED 燈";
6+
MSG.demoDescription = "偵測到聲音,讓圖片的燈泡發亮,並點亮 LED 燈";

views/tutorials/sound-1.handlebars

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<link rel="stylesheet" href="tutorials.css">
2+
3+
<style>
4+
#light{
5+
width:60%;
6+
}
7+
#light img{
8+
width:100%;
9+
display:none;
10+
}
11+
#light.off img:first-child{
12+
display:inline-block;
13+
}
14+
#light.on img:last-child{
15+
display:inline-block;
16+
}
17+
</style>
18+
19+
<div id="demoArea">
20+
<div id="demoTitle">{{demoTitle}}</div>
21+
<div id="demoDescription">{{demoDescription}}</div>
22+
<div id="light" class="off">
23+
<img src='http://i.imgur.com/T5H4MHE.png'></img>
24+
<img src='http://i.imgur.com/8qFj2Ou.png'></img>
25+
</div>
26+
</div>
27+
<table width="60%" height="100%">
28+
<tr>
29+
<td>
30+
<h1>
31+
<a href="index-tutorials.html"><span id="backIndex">{{backIndex}}</span></a> >
32+
<span id="title">...</span><span id="subTitle">{{subTitle}}</span>
33+
</h1>
34+
</td>
35+
<td class="farSide">
36+
<select id="languageMenu"></select>
37+
</td>
38+
</tr>
39+
<tr>
40+
<td colspan=2>
41+
<table width="100%">
42+
<tr id="tabRow" height="1em">
43+
<td id="tab_blocks" class="tabon">{{blocks}}</td>
44+
<td class="tabmin">&nbsp;</td>
45+
<td id="tab_javascript" class="taboff">JavaScript</td>
46+
<td class="tabmin">&nbsp;</td>
47+
<td id="tab_xml" class="taboff" style="display:none;">XML</td>
48+
<td class="tabmax">
49+
<button id="trashButton" class="notext" title="{{trashTooltip}}">
50+
<img src='media/1x1.gif' class="trash icon21">
51+
</button>
52+
<button id="linkButton" class="notext" title="{{linkTooltip}}">
53+
<img src='media/1x1.gif' class="link icon21">
54+
</button>
55+
<button id="runButton" class="notext primary" title="{{runTooltip}}">
56+
<img src='media/1x1.gif' class="run icon21">
57+
</button>
58+
</td>
59+
</tr>
60+
</table>
61+
</td>
62+
</tr>
63+
<tr>
64+
<td height="99%" colspan=2 id="content_area">
65+
</td>
66+
</tr>
67+
</table>
68+
69+
<div id="content_blocks" class="content"></div>
70+
<pre id="content_javascript" class="content"></pre>
71+
<textarea id="content_xml" class="content" wrap="off"></textarea>
72+
73+
<xml id="toolbox" style="display: none">
74+
<category id="catVariables" custom="VARIABLE"></category>
75+
<category id="catMath">
76+
<block type="math_number"></block>
77+
</category>
78+
<sep></sep>
79+
<category id="catBoard">
80+
<block type="board_ready">
81+
<value name="device_">
82+
<block type="text"></block>
83+
</value>
84+
</block>
85+
</category>
86+
<category id="catSound">
87+
<block type="variables_set">
88+
<field name="VAR">sound</field>
89+
<value name="VALUE">
90+
<block type="sound_new">
91+
<field name="pin_">10</field>
92+
</block>
93+
</value>
94+
</block>
95+
<block type="sound_status"></block>
96+
</category>
97+
<category id="catTutorials">
98+
<block type="light"></block>
99+
<block type="timer"></block>
100+
</category>
101+
<sep></sep>
102+
</xml>

views/tutorials/sound-2.handlebars

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
<link rel="stylesheet" href="tutorials.css">
2+
3+
<style>
4+
#light{
5+
width:60%;
6+
}
7+
#light img{
8+
width:100%;
9+
display:none;
10+
}
11+
#light.off img:first-child{
12+
display:inline-block;
13+
}
14+
#light.on img:last-child{
15+
display:inline-block;
16+
}
17+
</style>
18+
19+
<div id="demoArea">
20+
<div id="demoTitle">{{demoTitle}}</div>
21+
<div id="demoDescription">{{demoDescription}}</div>
22+
<div id="light" class="off">
23+
<img src='http://i.imgur.com/T5H4MHE.png'></img>
24+
<img src='http://i.imgur.com/8qFj2Ou.png'></img>
25+
</div>
26+
</div>
27+
<table width="60%" height="100%">
28+
<tr>
29+
<td>
30+
<h1>
31+
<a href="index-tutorials.html"><span id="backIndex">{{backIndex}}</span></a> >
32+
<span id="title">...</span><span id="subTitle">{{subTitle}}</span>
33+
</h1>
34+
</td>
35+
<td class="farSide">
36+
<select id="languageMenu"></select>
37+
</td>
38+
</tr>
39+
<tr>
40+
<td colspan=2>
41+
<table width="100%">
42+
<tr id="tabRow" height="1em">
43+
<td id="tab_blocks" class="tabon">{{blocks}}</td>
44+
<td class="tabmin">&nbsp;</td>
45+
<td id="tab_javascript" class="taboff">JavaScript</td>
46+
<td class="tabmin">&nbsp;</td>
47+
<td id="tab_xml" class="taboff" style="display:none;">XML</td>
48+
<td class="tabmax">
49+
<button id="trashButton" class="notext" title="{{trashTooltip}}">
50+
<img src='media/1x1.gif' class="trash icon21">
51+
</button>
52+
<button id="linkButton" class="notext" title="{{linkTooltip}}">
53+
<img src='media/1x1.gif' class="link icon21">
54+
</button>
55+
<button id="runButton" class="notext primary" title="{{runTooltip}}">
56+
<img src='media/1x1.gif' class="run icon21">
57+
</button>
58+
</td>
59+
</tr>
60+
</table>
61+
</td>
62+
</tr>
63+
<tr>
64+
<td height="99%" colspan=2 id="content_area">
65+
</td>
66+
</tr>
67+
</table>
68+
69+
<div id="content_blocks" class="content"></div>
70+
<pre id="content_javascript" class="content"></pre>
71+
<textarea id="content_xml" class="content" wrap="off"></textarea>
72+
73+
<xml id="toolbox" style="display: none">
74+
<category id="catVariables" custom="VARIABLE"></category>
75+
<category id="catMath">
76+
<block type="math_number"></block>
77+
</category>
78+
<sep></sep>
79+
<category id="catBoard">
80+
<block type="board_ready">
81+
<value name="device_">
82+
<block type="text"></block>
83+
</value>
84+
</block>
85+
</category>
86+
<category id="catLed">
87+
<block type="variables_set">
88+
<field name="VAR">led</field>
89+
<value name="VALUE">
90+
<block type="led_new">
91+
<field name="pin_">10</field>
92+
</block>
93+
</value>
94+
</block>
95+
<block type="led_state">
96+
<field name="led_">led</field>
97+
</block>
98+
</category>
99+
<category id="catSound">
100+
<block type="variables_set">
101+
<field name="VAR">sound</field>
102+
<value name="VALUE">
103+
<block type="sound_new">
104+
<field name="pin_">10</field>
105+
</block>
106+
</value>
107+
</block>
108+
<block type="sound_status"></block>
109+
</category>
110+
<category id="catTutorials">
111+
<block type="light"></block>
112+
<block type="timer"></block>
113+
</category>
114+
<sep></sep>
115+
</xml>

0 commit comments

Comments
 (0)