Skip to content

Commit

Permalink
Merge pull request #301 from SungminSeung/master
Browse files Browse the repository at this point in the history
dplay 블럭 수정 및 추가
  • Loading branch information
boolgom committed May 26, 2016
2 parents ef5ccd8 + e07c9eb commit 49b6f10
Show file tree
Hide file tree
Showing 3 changed files with 584 additions and 132 deletions.
17 changes: 12 additions & 5 deletions extern/util/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,18 +278,25 @@ EntryStatic.getAllBlocks = function() {
"arduino_convert_scale",
//dplay
"dplay_get_number_sensor_value",
"dplay_get_digital_value",
"dplay_toggle_led",
"dplay_toggle_pwm",
"dplay_convert_scale",
"dplay_get_value",
"dplay_get_gas_sensor_value",
"dplay_get_dust_sensor_value",
"dplay_get_CO2_sensor_value",
"dplay_convert_scale",
"dplay_get_digital_value",
"dplay_get_switch_status",
"dplay_get_tilt",
"dplay_get_light_status",
"dplay_toggle_led",
"dplay_toggle_pwm",
"dplay_select_led",
"dplay_DCmotor",
"dplay_DCmotor_speed",
"dplay_buzzer",
"dplay_servo",
"dplay_Robot_run",
"dplay_Robot_run_sec",
"dplay_robot_speed_sel",
"dplay_robot_stop",
//nemoino
"nemoino_get_number_sensor_value",
"nemoino_get_digital_value",
Expand Down
21 changes: 19 additions & 2 deletions src/blocks/block_arduino.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,24 @@ Entry.SensorBoard = {

Entry.dplay = {
name: 'dplay',
setZero: Entry.Arduino.setZero
vel_value : 255,
setZero: Entry.Arduino.setZero,
timeouts: [],
removeTimeout: function(id) {
clearTimeout(id);
var timeouts = this.timeouts;
var index = timeouts.indexOf(id);
if(index >= 0) {
timeouts.splice(index, 1);
}
},
removeAllTimeouts: function() {
var timeouts = this.timeouts;
for(var i in timeouts) {
clearTimeout(timeouts[i]);
}
this.timeouts = [];
}
};

Entry.nemoino = {
Expand Down Expand Up @@ -919,7 +936,7 @@ Entry.block.dplay_DCmotor = function (sprite, script) {
var port1 = script.getField("PORT");
var port2 = 0;
if (port1 == "3") port2 = 5;
else if (port1 == "6") value2 = 11;
else if (port1 == "6") port2 = 11;
var operator = script.getField("OPERATOR");
var value1 = 0;
var value2 = 0;
Expand Down
Loading

0 comments on commit 49b6f10

Please sign in to comment.