Skip to content

Commit c52a8be

Browse files
authored
Merge pull request #639 from MatzElectronics/patch-10
LCD command block update
2 parents 1f6b193 + a6ef146 commit c52a8be

File tree

2 files changed

+29
-16
lines changed

2 files changed

+29
-16
lines changed

src/main/webapp/cdn/blockly/generators/propc/debug_LCD.js

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@ Blockly.Blocks.debug_lcd_init = {
4343
}
4444
};
4545

46-
Blockly.Blocks.debug_lcd_clear = {
47-
init: function () {
48-
this.setColour(colorPalette.getColor('protocols'));
49-
this.appendDummyInput()
50-
.appendField("LCD clear");
51-
52-
this.setPreviousStatement(true, null);
53-
this.setNextStatement(true, null);
54-
}
55-
};
46+
//Blockly.Blocks.debug_lcd_clear = {
47+
// init: function () {
48+
// this.setColour(colorPalette.getColor('protocols'));
49+
// this.appendDummyInput()
50+
// .appendField("LCD clear");
51+
//
52+
// this.setPreviousStatement(true, null);
53+
// this.setNextStatement(true, null);
54+
// }
55+
//};
5656

5757
Blockly.Blocks.debug_lcd_print = {
5858
init: function () {
@@ -85,8 +85,21 @@ Blockly.Blocks.debug_lcd_action = {
8585
init: function () {
8686
this.setColour(colorPalette.getColor('protocols'));
8787
this.appendDummyInput()
88-
.appendField("LCD action")
89-
.appendField(new Blockly.FieldDropdown([["newline", "13"]]), "ACTION");
88+
.appendField("LCD command")
89+
.appendField(new Blockly.FieldDropdown([
90+
["clear screen", "12"],
91+
["move cursor right", "9"],
92+
["move cursor left", "8"],
93+
["move cursor down", "10"],
94+
["carriage return", "13"],
95+
["backlight on", "17"],
96+
["backlight off", "18"],
97+
["display off", "21"],
98+
["display on, cursor off", "22"],
99+
["display on, cursor off, blink", "23"],
100+
["display on, cursor on", "24"],
101+
["display on, cursor on, blink", "25"]
102+
]), "ACTION");
90103

91104
this.setPreviousStatement(true, null);
92105
this.setNextStatement(true, null);
@@ -103,9 +116,9 @@ Blockly.propc.debug_lcd_init = function () {
103116
return code;
104117
};
105118

106-
Blockly.propc.debug_lcd_clear = function () {
107-
return 'writeChar(debug_lcd, 12);\npause(5);\n';
108-
};
119+
//Blockly.propc.debug_lcd_clear = function () {
120+
// return 'writeChar(debug_lcd, 12);\npause(5);\n';
121+
//};
109122

110123
Blockly.propc.debug_lcd_print = function () {
111124
var text = this.getFieldValue('TEXT');

src/main/webapp/frame/framec.jsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@
221221
<category name="<fmt:message key="category.communicate" />" exclude="heb" colour="320">
222222
<category name="<fmt:message key="category.communicate.serial-lcd" />">
223223
<block type="debug_lcd_init"></block>
224-
<block type="debug_lcd_clear"></block>
224+
<%-- <block type="debug_lcd_clear"></block> --%>
225225
<block type="debug_lcd_print"></block>
226226
<block type="debug_lcd_number"></block>
227227
<block type="debug_lcd_action"></block>

0 commit comments

Comments
 (0)