-
-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
111 changed files
with
3,004 additions
and
1,880 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,216 @@ | ||
'use strict'; | ||
|
||
goog.provide('Blockly.Blocks.MRduino2'); | ||
|
||
goog.require('Blockly.Blocks'); | ||
goog.require('Blockly.Types'); | ||
|
||
|
||
Blockly.Blocks['MRduino2_init'] = { | ||
init: function() { | ||
this.setColour(Blockly.Blocks.MRduino2.HUE); | ||
this.setHelpUrl('http://www.macerobotics.com'); | ||
this.setInputsInline(true); | ||
this.appendDummyInput("") | ||
.appendField(Blockly.Msg.MRduino2_init) | ||
this.setPreviousStatement(true, null); | ||
this.setNextStatement(true, null); | ||
this.setTooltip('Initialisation du robot MRduino2'); | ||
} | ||
}; | ||
|
||
Blockly.Blocks['MRduino2_forward'] = { | ||
init: function() { | ||
this.setColour(Blockly.Blocks.MRduino2.HUE); | ||
this.appendValueInput("PWM", 'Number') | ||
.setCheck('Number') | ||
.setAlign(Blockly.ALIGN_RIGHT) | ||
.appendField(Blockly.Msg.MRduino2_forward); | ||
this.setPreviousStatement(true, null); | ||
this.setNextStatement(true, null); | ||
this.setTooltip('Bloc pour faire avancer le robot avec une vitesse en 0 et 100%'); | ||
} | ||
}; | ||
|
||
Blockly.Blocks['MRduino2_forward_mm'] = { | ||
init: function() { | ||
this.setColour(Blockly.Blocks.MRduino2.HUE); | ||
this.appendValueInput("PWM", 'Number') | ||
.setCheck('Number') | ||
.setAlign(Blockly.ALIGN_RIGHT) | ||
.appendField(Blockly.Msg.MRduino2_forward_mm); | ||
this.setPreviousStatement(true, null); | ||
this.setNextStatement(true, null); | ||
} | ||
}; | ||
|
||
Blockly.Blocks['MRduino2_stop'] = { | ||
init: function() { | ||
this.setColour(Blockly.Blocks.MRduino2.HUE); | ||
this.setHelpUrl('http://www.macerobotics.com'); | ||
this.setInputsInline(true); | ||
this.appendDummyInput("") | ||
.appendField(Blockly.Msg.MRduino2_stop) | ||
this.setPreviousStatement(true, null); | ||
this.setNextStatement(true, null); | ||
this.setTooltip('Bloc pour arreter le robot'); | ||
} | ||
}; | ||
|
||
Blockly.Blocks['MRduino2_back'] = { | ||
init: function() { | ||
this.setColour(Blockly.Blocks.MRduino2.HUE); | ||
this.appendValueInput("PWM", 'Number') | ||
.setCheck('Number') | ||
.setAlign(Blockly.ALIGN_RIGHT) | ||
.appendField(Blockly.Msg.MRduino2_back); | ||
this.setPreviousStatement(true, null); | ||
this.setNextStatement(true, null); | ||
this.setTooltip('Bloc pour faire reculer le robot avec une vitesse en 0 et 100%'); | ||
} | ||
}; | ||
|
||
Blockly.Blocks['MRduino2_back_mm'] = { | ||
init: function() { | ||
this.setColour(Blockly.Blocks.MRduino2.HUE); | ||
this.appendValueInput("PWM", 'Number') | ||
.setCheck('Number') | ||
.setAlign(Blockly.ALIGN_RIGHT) | ||
.appendField(Blockly.Msg.MRduino2_back_mm); | ||
this.setPreviousStatement(true, null); | ||
this.setNextStatement(true, null); | ||
} | ||
}; | ||
|
||
Blockly.Blocks['MRduino2_motorRight'] = { | ||
init: function() { | ||
this.setColour(Blockly.Blocks.MRduino2.HUE); | ||
this.appendValueInput("PWM", 'Number') | ||
.setCheck('Number') | ||
.setAlign(Blockly.ALIGN_RIGHT) | ||
.appendField(Blockly.Msg.MRduino2_motorRight); | ||
this.appendValueInput("DIR", 'Number') | ||
.setCheck('Number') | ||
.setAlign(Blockly.ALIGN_RIGHT) | ||
.appendField(Blockly.Msg.MRduino2_motorRightDir); | ||
this.setPreviousStatement(true, null); | ||
this.setNextStatement(true, null); | ||
} | ||
}; | ||
|
||
Blockly.Blocks['MRduino2_motorLeft'] = { | ||
init: function() { | ||
this.setColour(Blockly.Blocks.MRduino2.HUE); | ||
this.appendValueInput("PWM", 'Number') | ||
.setCheck('Number') | ||
.setAlign(Blockly.ALIGN_RIGHT) | ||
.appendField(Blockly.Msg.MRduino2_motorLeft); | ||
this.appendValueInput("DIR", 'Number') | ||
.setCheck('Number') | ||
.setAlign(Blockly.ALIGN_RIGHT) | ||
.appendField(Blockly.Msg.MRduino2_motorLeftDir); | ||
this.setPreviousStatement(true, null); | ||
this.setNextStatement(true, null); | ||
} | ||
}; | ||
|
||
Blockly.Blocks['MRduino2_turnLeft'] = { | ||
init: function() { | ||
this.setColour(Blockly.Blocks.MRduino2.HUE); | ||
this.appendValueInput("PWM", 'Number') | ||
.setCheck('Number') | ||
.setAlign(Blockly.ALIGN_RIGHT) | ||
.appendField(Blockly.Msg.MRduino2_turnLeft); | ||
this.setPreviousStatement(true, null); | ||
this.setNextStatement(true, null); | ||
} | ||
}; | ||
|
||
Blockly.Blocks['MRduino2_turnLeft_degree'] = { | ||
init: function() { | ||
this.setColour(Blockly.Blocks.MRduino2.HUE); | ||
this.appendValueInput("PWM", 'Number') | ||
.setCheck('Number') | ||
.setAlign(Blockly.ALIGN_RIGHT) | ||
.appendField(Blockly.Msg.MRduino2_turnLeft_degree); | ||
this.setPreviousStatement(true, null); | ||
this.setNextStatement(true, null); | ||
} | ||
}; | ||
|
||
Blockly.Blocks['MRduino2_turnRight_degree'] = { | ||
init: function() { | ||
this.setColour(Blockly.Blocks.MRduino2.HUE); | ||
this.appendValueInput("PWM", 'Number') | ||
.setCheck('Number') | ||
.setAlign(Blockly.ALIGN_RIGHT) | ||
.appendField(Blockly.Msg.MRduino2_turnRight_degree); | ||
this.setPreviousStatement(true, null); | ||
this.setNextStatement(true, null); | ||
} | ||
}; | ||
|
||
Blockly.Blocks['MRduino2_turnRight'] = { | ||
init: function() { | ||
this.setColour(Blockly.Blocks.MRduino2.HUE); | ||
this.appendValueInput("PWM", 'Number') | ||
.setCheck('Number') | ||
.setAlign(Blockly.ALIGN_RIGHT) | ||
.appendField(Blockly.Msg.MRduino2_turnRight); | ||
this.setPreviousStatement(true, null); | ||
this.setNextStatement(true, null); | ||
} | ||
}; | ||
|
||
Blockly.Blocks['MRduino2_proxSensor'] = { | ||
init: function() { | ||
this.setColour("#778E9A"); | ||
this.setHelpUrl('http://www.macerobotics.com'); | ||
this.setInputsInline(true); | ||
this.appendDummyInput("") | ||
.appendField(Blockly.Msg.MRduino2_proxSensor) | ||
this.setPreviousStatement(false, null); | ||
this.setNextStatement(false, null); | ||
this.setOutput(true, 'Number'); | ||
this.setTooltip('proxSensor'); | ||
} | ||
}; | ||
|
||
Blockly.Blocks['MRduino2_ledRight'] = { | ||
init: function() { | ||
this.setColour(Blockly.Blocks.MRduino2.HUE); | ||
this.appendValueInput("PWM", 'Number') | ||
.setCheck('Number') | ||
.setAlign(Blockly.ALIGN_RIGHT) | ||
.appendField(Blockly.Msg.MRduino2_ledRight); | ||
this.setPreviousStatement(true, null); | ||
this.setNextStatement(true, null); | ||
} | ||
}; | ||
|
||
Blockly.Blocks['MRduino2_ledLeft'] = { | ||
init: function() { | ||
this.setColour(Blockly.Blocks.MRduino2.HUE); | ||
this.appendValueInput("PWM", 'Number') | ||
.setCheck('Number') | ||
.setAlign(Blockly.ALIGN_RIGHT) | ||
.appendField(Blockly.Msg.MRduino2_ledLeft); | ||
this.setPreviousStatement(true, null); | ||
this.setNextStatement(true, null); | ||
} | ||
}; | ||
|
||
Blockly.Blocks['MRduino2_battery'] = { | ||
init: function() { | ||
this.setColour(Blockly.Blocks.MRduino2.HUE); | ||
this.setHelpUrl('http://www.macerobotics.com'); | ||
this.setInputsInline(true); | ||
this.appendDummyInput("") | ||
.appendField(Blockly.Msg.MRduino2_battery) | ||
this.setPreviousStatement(false, null); | ||
this.setNextStatement(false, null); | ||
this.setOutput(true, 'float'); | ||
this.setTooltip('battery'); | ||
} | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
Blockly.Blocks.MRduino2_init.getBlockType = function() { | ||
return Blockly.Types.NULL; | ||
}; | ||
Blockly.Blocks.MRduino2_forward.getBlockType = function() { | ||
return Blockly.Types.NULL; | ||
}; | ||
Blockly.Blocks.MRduino2_forward_mm.getBlockType = function() { | ||
return Blockly.Types.NULL; | ||
}; | ||
Blockly.Blocks.MRduino2_stop.getBlockType = function() { | ||
return Blockly.Types.NULL; | ||
}; | ||
Blockly.Blocks.MRduino2_back.getBlockType = function() { | ||
return Blockly.Types.NULL; | ||
}; | ||
Blockly.Blocks.MRduino2_back_mm.getBlockType = function() { | ||
return Blockly.Types.TEXT; | ||
}; | ||
Blockly.Blocks.MRduino2_motorRight.getBlockType = function() { | ||
return Blockly.Types.NULL; | ||
}; | ||
Blockly.Blocks.MRduino2_motorLeft.getBlockType = function() { | ||
return Blockly.Types.NULL; | ||
}; | ||
Blockly.Blocks.MRduino2_turnLeft.getBlockType = function() { | ||
return Blockly.Types.BOOLEAN; | ||
}; | ||
Blockly.Blocks.MRduino2_turnLeft_degree.getBlockType = function() { | ||
return Blockly.Types.TEXT; | ||
}; | ||
Blockly.Blocks.MRduino2_turnRight_degree.getBlockType = function() { | ||
return Blockly.Types.NULL; | ||
}; | ||
Blockly.Blocks.MRduino2_turnRight.getBlockType = function() { | ||
return Blockly.Types.NULL; | ||
}; | ||
Blockly.Blocks.MRduino2_proxSensor.getBlockType = function() { | ||
return Blockly.Types.NUMBER; | ||
}; | ||
Blockly.Blocks.MRduino2_ledRight.getBlockType = function() { | ||
return Blockly.Types.BOOLEAN; | ||
}; | ||
Blockly.Blocks.MRduino2_ledLeft.getBlockType = function() { | ||
return Blockly.Types.BOOLEAN; | ||
}; | ||
Blockly.Blocks.MRduino2_battery.getBlockType = function() { | ||
return Blockly.Types.NUMBER; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Blockly.Blocks.seeed_music_shield_addtolist.getBlockType = function() { | ||
return Blockly.Types.NUMBER; | ||
}; | ||
Blockly.Blocks.seeed_music_shield_playlist.getBlockType = function() { | ||
return Blockly.Types.NUMBER; | ||
}; | ||
Blockly.Blocks.seeed_music_shield_playmode.getBlockType = function() { | ||
return Blockly.Types.NUMBER; | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions
51
blocks/seeed/seeed_music_shield_2.2/seeed_music_shield_2.2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// define blocks | ||
'use strict'; | ||
|
||
goog.provide('Blockly.Blocks.seeed_music_shield'); | ||
|
||
goog.require('Blockly.Blocks'); | ||
goog.require('Blockly.Types'); | ||
|
||
|
||
|
||
Blockly.Blocks['seeed_music_shield_addtolist'] = { | ||
init: function() { | ||
this.appendValueInput("FILE_NAME") | ||
.setCheck("String") | ||
.appendField("ajouter à la liste le fichier"); | ||
this.setInputsInline(false); | ||
this.setPreviousStatement(true); | ||
this.setNextStatement(true); | ||
this.setColour(Blockly.Blocks.seeed_music_shield.HUE); | ||
this.setTooltip('ce bloc sert à...'); | ||
this.setHelpUrl('http://wiki.seeedstudio.com/Music_Shield_V2.2/'); | ||
} | ||
}; | ||
|
||
Blockly.Blocks['seeed_music_shield_playlist'] = { | ||
init: function() { | ||
this.appendDummyInput() | ||
.appendField("lire toute la liste de lecture"); | ||
this.setInputsInline(false); | ||
this.setPreviousStatement(true); | ||
this.setNextStatement(true); | ||
this.setColour(Blockly.Blocks.seeed_music_shield.HUE); | ||
this.setTooltip('ce bloc sert à...'); | ||
this.setHelpUrl('http://wiki.seeedstudio.com/Music_Shield_V2.2/'); | ||
} | ||
}; | ||
|
||
Blockly.Blocks['seeed_music_shield_playmode'] = { | ||
init: function() { | ||
this.appendDummyInput() | ||
.appendField("définir le mode de lecture à") | ||
.appendField(new Blockly.FieldDropdown([["continue", "PM_NORMAL_PLAY"], ["aléatoire", "PM_SHUFFLE_PLAY"], ["répéter liste", "PM_REPEAT_LIST"], ["répéter chanson", "PM_REPEAT_ONE"]]), "PlayMode"); | ||
this.setInputsInline(false); | ||
this.setPreviousStatement(true); | ||
this.setNextStatement(true); | ||
this.setColour(Blockly.Blocks.seeed_music_shield.HUE); | ||
this.setTooltip('ce bloc sert à...'); | ||
this.setHelpUrl('http://wiki.seeedstudio.com/Music_Shield_V2.2/'); | ||
} | ||
}; | ||
|
Oops, something went wrong.