Skip to content

Commit

Permalink
dplay block modify
Browse files Browse the repository at this point in the history
dplay block modify
  • Loading branch information
SungminSeung committed May 25, 2016
1 parent 8dd37ab commit 3217e30
Show file tree
Hide file tree
Showing 3 changed files with 582 additions and 131 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
18 changes: 17 additions & 1 deletion src/blocks/block_arduino.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,23 @@ Entry.SensorBoard = {

Entry.dplay = {
name: 'dplay',
setZero: Entry.Arduino.setZero
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
Loading

0 comments on commit 3217e30

Please sign in to comment.