Skip to content

Commit 1fa25c5

Browse files
committed
Add the thirteenth stage
1 parent 88dd796 commit 1fa25c5

14 files changed

Lines changed: 161 additions & 5 deletions

File tree

blocks/msg/en.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,7 @@ Blockly.Msg.WEBDUINO_MAX7219_BTN3 = "Button 3";
664664
Blockly.Msg.WEBDUINO_MAX7219_BTNSTOP = "Stop";
665665
Blockly.Msg.WEBDUINO_MAX7219_BTNOFF = "Turn off";
666666
Blockly.Msg.WEBDUINO_MAX7219_DO = "do:";
667+
Blockly.Msg.WEBDUINO_MAX7219_SET_SHOW_VALUE = "show value:";
667668

668669
// Tutorials - ADXL345
669670

blocks/msg/zh-hans.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,7 @@ Blockly.Msg.WEBDUINO_MAX7219_BTN3 = "按钮 3";
741741
Blockly.Msg.WEBDUINO_MAX7219_BTNSTOP = "停止动画";
742742
Blockly.Msg.WEBDUINO_MAX7219_BTNOFF = "关闭";
743743
Blockly.Msg.WEBDUINO_MAX7219_DO = "执行";
744+
Blockly.Msg.WEBDUINO_MAX7219_SET_SHOW_VALUE = "显示数值";
744745

745746
// Tutorials - ADXL345
746747

blocks/msg/zh-hant.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,7 @@ Blockly.Msg.WEBDUINO_MAX7219_BTN3 = "按鈕 3";
741741
Blockly.Msg.WEBDUINO_MAX7219_BTNSTOP = "停止動畫";
742742
Blockly.Msg.WEBDUINO_MAX7219_BTNOFF = "關閉";
743743
Blockly.Msg.WEBDUINO_MAX7219_DO = "執行";
744+
Blockly.Msg.WEBDUINO_MAX7219_SET_SHOW_VALUE = "顯示數值";
744745

745746
// Tutorials - ADXL345
746747

blocks/stages.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,18 @@ Blockly.Blocks['tutorial_max7219_button'] = {
903903
}
904904
};
905905

906+
Blockly.Blocks['stage_max7219_set_value'] = {
907+
init: function () {
908+
this.appendValueInput("show_")
909+
.appendField(Blockly.Msg.WEBDUINO_MAX7219_SET_SHOW_VALUE, "show value:");
910+
this.setPreviousStatement(true);
911+
this.setNextStatement(true);
912+
this.setTooltip('');
913+
this.setColour(Blockly.Blocks.colour.HUE);
914+
this.setHelpUrl('http://www.example.com/');
915+
}
916+
};
917+
906918
/*
907919
.o8 oooo .oooo. .o oooooooo
908920
"888 `888 .dP""Y88b .d88 dP"""""""

generators/stages.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,12 @@ Blockly.JavaScript['tutorial_max7219_button'] = function (block) {
771771
return code;
772772
};
773773

774+
Blockly.JavaScript['stage_max7219_set_value'] = function (block) {
775+
var value_show_ = Blockly.JavaScript.valueToCode(block, 'show_', Blockly.JavaScript.ORDER_ATOMIC);
776+
var code = 'document.getElementById("show").innerHTML = ' + value_show_ + ';\n';
777+
return code;
778+
};
779+
774780
/*
775781
.o8 oooo .oooo. .o oooooooo
776782
"888 `888 .dP""Y88b .d88 dP"""""""

index-stages-en.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ <h4><a href="./?lang=en&page=stages/buzzer-2" target="_blank">10、Music Creatio
7373
<!-- <div>( <a href="https://youtu.be/NA2kjjwoWNA" target="_blank">影片教學</a> | <a href="./?lang=en&page=stages/buzzer-2#-KcVrZvab1_qqs5wWVP9" target="_blank">Solution</a> )</div> -->
7474
<div>( <a href="./?lang=en&page=stages/buzzer-2#-KcVrZvab1_qqs5wWVP9" target="_blank">Solution</a> )</div>
7575
</li>
76+
<li>
77+
<h4><a href="./?lang=en&page=stages/max7219-7" target="_blank">13、Ticker</a></h4>
78+
<div>( <a href="./?lang=en&page=stages/max7219-7#-KmUaEt-0XZkfN6h5iZv" target="_blank">Solution</a> )</div>
79+
</li>
7680
<li>
7781
<h4><a href="./?lang=en&page=stages/servo-4" target="_blank">14、Controlling a Servomotor with a Button Switch</a></h4>
7882
<div>( <a href="./?lang=en&page=stages/servo-4#-KmQBS3R8wxsRh3LZzKV" target="_blank">Solution</a> )</div>

index-stages-zh-hans.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ <h4><a href="./?lang=zh-hans&page=stages/buzzer-2" target="_blank">10、小小
7373
<!-- <div>( <a href="https://youtu.be/NA2kjjwoWNA" target="_blank">影片教学</a> | <a href="./?lang=zh-hant&page=stages/buzzer-2#-KcVrZvab1_qqs5wWVP9" target="_blank">解答</a> )</div> -->
7474
<div>( <a href="./?lang=zh-hans&page=stages/buzzer-2#-KcVrZvab1_qqs5wWVP9" target="_blank">解答</a> )</div>
7575
</li>
76+
<li>
77+
<h4><a href="./?lang=zh-hans&page=stages/max7219-7" target="_blank">13、叫号器</a></h4>
78+
<div>( <a href="./?lang=zh-hans&page=stages/max7219-7#-KmUaEt-0XZkfN6h5iZv" target="_blank">解答</a> )</div>
79+
</li>
7680
<li>
7781
<h4><a href="./?lang=zh-hans&page=stages/servo-4" target="_blank">14、闸道控制</a></h4>
7882
<div>( <a href="./?lang=zh-hans&page=stages/servo-4#-KmQBS3R8wxsRh3LZzKV" target="_blank">解答</a> )</div>

index-stages.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ <h4><a href="./?lang=zh-hant&page=stages/buzzer-2" target="_blank">11</a></h4>
8080
<li>
8181
<h4><a href="./?lang=zh-hant&page=stages/buzzer-2" target="_blank">12</a></h4>
8282
<div>( <a href="./?lang=zh-hant&page=stages/buzzer-2#-KhVwV7YR6NSKWqmzc_Z" target="_blank">解答</a> )</div>
83-
</li>
83+
</li>-->
8484
<li>
85-
<h4><a href="./?lang=zh-hant&page=stages/buzzer-2" target="_blank">13</a></h4>
86-
<div>( <a href="./?lang=zh-hant&page=stages/buzzer-2#-KhVwV7YR6NSKWqmzc_Z" target="_blank">解答</a> )</div>
87-
</li> -->
85+
<h4><a href="./?lang=zh-hant&page=stages/max7219-7" target="_blank">13、叫號器</a></h4>
86+
<div>( <a href="./?lang=zh-hant&page=stages/max7219-7#-KmUaEt-0XZkfN6h5iZv" target="_blank">解答</a> )</div>
87+
</li>
8888
<li>
8989
<h4><a href="./?lang=zh-hant&page=stages/servo-4" target="_blank">14、閘道控制</a></h4>
9090
<div>( <a href="./?lang=zh-hant&page=stages/servo-4#-KmQBS3R8wxsRh3LZzKV" target="_blank">解答</a> )</div>

msg/stages/buzzer-2/en.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MSG.title = "Webduino Blockly Stage 10 : Music Creation with a Buzzer";
22
MSG.subTitle = "Stage 10 : Music Creation with a Buzzer";
3-
MSG.demoDescription = "Create aother piece of music and play it with the buzzer.";
3+
MSG.demoDescription = "Create another piece of music and play it with the buzzer.";
44
MSG.notes = "Notes:";
55
MSG.tempos = "Tempos:";
66
MSG.stageHelp = "Music Creation with a Buzzer.";

msg/stages/max7219-7/en.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)