Skip to content

Commit 661b0b6

Browse files
committed
add pir tutorial 1 and 2
1 parent 98da620 commit 661b0b6

7 files changed

Lines changed: 245 additions & 0 deletions

File tree

index-tutorials.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,18 @@ <h4><a href="./?lang=zh-hant&page=tutorials/dht-2" target="_blank">偵測溫濕
177177
</li>
178178
</ul>
179179
<br/>
180+
<h3>人體紅外線偵測</h3>
181+
<ul>
182+
<li>
183+
<h4><a href="./?lang=zh-hant&page=tutorials/pir-1" target="_blank">偵測人體紅外線</a></h4>
184+
( <a href="./?lang=zh-hant&page=tutorials/pir-1#-JvxRwAXj4ccyigeuI8o" target="_blank">解答</a> )
185+
</li>
186+
<li>
187+
<h4><a href="./?lang=zh-hant&page=tutorials/pir-2" target="_blank">偵測人體紅外線點亮 LED 燈</a></h4>
188+
( <a href="./?lang=zh-hant&page=tutorials/pir-2#-JvxTHIG_0PBVOJToz3p" target="_blank">解答</a> )
189+
</li>
190+
</ul>
191+
<br/>
180192
<script>
181193
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
182194
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

msg/tutorials/pir-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 : PIR";
6+
MSG.demoDescription = "If it detects human infra-red change light bulb glows";

msg/tutorials/pir-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 = "課程 6-1:偵測人體紅外線";
6+
MSG.demoDescription = "偵測到人體紅外線變化時,讓圖片的燈泡發亮";

msg/tutorials/pir-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-2 : PIR and LED";
6+
MSG.demoDescription = "If it detects human infra-red change light bulb and LED glows";

msg/tutorials/pir-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 = "課程 6-2:偵測人體紅外線點亮 LED 燈";
6+
MSG.demoDescription = "偵測到人體紅外線變化時,讓圖片的燈泡發亮,並點亮 LED 燈";

views/tutorials/pir-1.handlebars

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
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+
<sep></sep>
76+
<category id="catBoard">
77+
<block type="board_ready">
78+
<value name="device_">
79+
<block type="text"></block>
80+
</value>
81+
</block>
82+
</category>
83+
<category id="catPir">
84+
<block type="variables_set">
85+
<field name="VAR">pir</field>
86+
<value name="VALUE">
87+
<block type="pir_new">
88+
<field name="pin_">10</field>
89+
</block>
90+
</value>
91+
</block>
92+
<block type="pir_status"></block>
93+
</category>
94+
<category id="catTutorials">
95+
<block type="light"></block>
96+
</category>
97+
<sep></sep>
98+
</xml>

views/tutorials/pir-2.handlebars

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
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+
<sep></sep>
76+
<category id="catBoard">
77+
<block type="board_ready">
78+
<value name="device_">
79+
<block type="text"></block>
80+
</value>
81+
</block>
82+
</category>
83+
<category id="catLed">
84+
<block type="variables_set">
85+
<field name="VAR">led</field>
86+
<value name="VALUE">
87+
<block type="led_new">
88+
<field name="pin_">10</field>
89+
</block>
90+
</value>
91+
</block>
92+
<block type="led_state">
93+
<field name="led_">led</field>
94+
</block>
95+
</category>
96+
<category id="catPir">
97+
<block type="variables_set">
98+
<field name="VAR">pir</field>
99+
<value name="VALUE">
100+
<block type="pir_new">
101+
<field name="pin_">10</field>
102+
</block>
103+
</value>
104+
</block>
105+
<block type="pir_status"></block>
106+
</category>
107+
<category id="catTutorials">
108+
<block type="light"></block>
109+
</category>
110+
<sep></sep>
111+
</xml>

0 commit comments

Comments
 (0)