Skip to content

Commit

Permalink
Merge pull request #2840 from myunghwahong/develop-hw
Browse files Browse the repository at this point in the history
Add IR sensor reset function block for Altino & Edit block shape for Altino and Altino Lite
  • Loading branch information
Tnks2U authored Oct 24, 2024
2 parents 8302f5d + a8b0023 commit 617cd07
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 6 deletions.
40 changes: 38 additions & 2 deletions src/playground/blocks/hardware/block_altino.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Entry.Altino = {
dot6: 0,
dot7: 0,
dot8: 0,
command: 0,
},
setZero: function() {
var portMap = Entry.Altino.PORT_MAP;
Expand Down Expand Up @@ -69,6 +70,7 @@ Entry.Altino.blockMenuBlocks = [
'altino_dot_display_hex',
'altino_dot_display_matrix_on',
'altino_dot_display_matrix_off',
'altino_ir_reset',
];

Entry.Altino.setLanguage = function() {
Expand Down Expand Up @@ -154,7 +156,7 @@ Entry.Altino.setLanguage = function() {
},
template: {
altino_analogValue: '알티노 %1 센서값',
altino_stopAll: '정지 %1°%2',
altino_stopAll: '정지 %1%2',
altino_dot_display: '표시하기 %1 %2',
altino_dot_display_line: '표시하기 %1 %2 %3 %4 %5 %6 %7 %8 %9 %10',
altino_dot_display_hex: '표시하기 %1 %2 %3 %4 %5 %6 %7 %8 %9',
Expand All @@ -167,6 +169,7 @@ Entry.Altino.setLanguage = function() {
altino_sound: '소리 %1 %2 %3',
altino_steering_hex: '조향 %1%2',
altino_steering: '조향 %1°%2',
altino_ir_reset: '알티노 IR 센서 초기화%1',
},
},
en: {
Expand Down Expand Up @@ -250,7 +253,7 @@ Entry.Altino.setLanguage = function() {
},
template: {
altino_analogValue: 'Altino %1 sensor value',
altino_stopAll: 'Stop %1°%2',
altino_stopAll: 'Stop %1%2',
altino_dot_display: 'Display %1 %2',
altino_dot_display_line: 'Display %1 %2 %3 %4 %5 %6 %7 %8 %9 %10',
altino_dot_display_hex: 'Display %1 %2 %3 %4 %5 %6 %7 %8 %9',
Expand All @@ -263,6 +266,7 @@ Entry.Altino.setLanguage = function() {
altino_sound: 'Sound %1 %2 %3',
altino_steering_hex: 'Steering %1%2',
altino_steering: 'Steering %1°%2',
altino_ir_reset: 'Reset Altino IR Sensor%1',
},
},
};
Expand Down Expand Up @@ -1457,6 +1461,38 @@ Entry.Altino.getBlocks = function() {
},
syntax: { js: [], py: ['Altino.dot_display_hex(%1, %2, %3, %4, %5, %6, %7, %8)'] },
},
altino_ir_reset: {
color: EntryStatic.colorSet.block.default.HARDWARE,
outerLine: EntryStatic.colorSet.block.darken.HARDWARE,
skeleton: 'basic',
statements: [],
params: [
{
type: 'Indicator',
img: 'block_icon/hardware_icon.svg',
size: 12,
},
],
events: {},
def: {
params: [
null,
],
type: 'altino_ir_reset',
},
paramsKeyMap: {
DEVICE : 0,
},
class: 'altino_output',
isNotFor: ['altino'],
func: function(sprite, script) {
var sq = Entry.hw.sendQueue;

sq.command = 252;
return script.callReturn();
},
syntax: { js: [], py: ['Altino.ir_reset'] },
},
//endregion Altino 알티노
};
};
Expand Down
6 changes: 2 additions & 4 deletions src/playground/blocks/hardware/block_altino_lite.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Entry.AltinoLite.setLanguage = function() {
altino_lite_sound: '소리 %1 %2 %3',
altino_lite_steering_hex: '조향 %1%2',
altino_lite_steering: '조향 %1°%2',
altino_lite_ir_reset: '알티노 라이트 IR 센서 초기화',
altino_lite_ir_reset: '알티노 라이트 IR 센서 초기화%1',
},
},
en: {
Expand Down Expand Up @@ -233,7 +233,7 @@ Entry.AltinoLite.setLanguage = function() {
altino_lite_sound: 'Sound %1 %2 %3',
altino_lite_steering_hex: 'Steering %1%2',
altino_lite_steering: 'Steering %1°%2',
altino_lite_ir_reset: 'Reset Altino lite IR Sensor',
altino_lite_ir_reset: 'Reset Altino lite IR Sensor%1',
},
},
};
Expand Down Expand Up @@ -1416,8 +1416,6 @@ Entry.AltinoLite.getBlocks = function() {
func: function(sprite, script) {
var sq = Entry.hw.sendQueue;

// sq.rightWheel = 300;//script.getNumberValue('rightWheel');
// sq.leftWheel = 300;//script.getNumberValue('leftWheel');
sq.ir = 6;
return script.callReturn();
},
Expand Down

0 comments on commit 617cd07

Please sign in to comment.