Skip to content

Commit

Permalink
add RoMeo BLE + font choice
Browse files Browse the repository at this point in the history
  • Loading branch information
SebCanet committed Feb 25, 2019
1 parent a9b6f2b commit 3e33ff7
Show file tree
Hide file tree
Showing 111 changed files with 3,004 additions and 1,880 deletions.
Binary file added Thumbs.db
Binary file not shown.
216 changes: 216 additions & 0 deletions blocks/MRduino2/MRduino2.js
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');
}
};

48 changes: 48 additions & 0 deletions blocks/MRduino2/blocks_typing.js
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;
};
2 changes: 2 additions & 0 deletions blocks/arduino_resume.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ head.load(
"blocks/mbot/mbot_3.js",
"blocks/mbot/mbot_4.js",
"blocks/MRduino/MRduino.js",
"blocks/MRduino2/MRduino2.js",
"blocks/multi-function/multi-function.js",
"blocks/myhumankit/myhumankit.js",
"blocks/nrf24l01/nrf24l01.js",
Expand All @@ -85,6 +86,7 @@ head.load(
"blocks/robots/robot_misc.js",
"blocks/robuno/robuno.js",
"blocks/seeed/grove/grove.js",
"blocks/seeed/seeed_music_shield_2.2/seeed_music_shield_2.2.js",
"blocks/sensor_actuator/sensor_actuator.js",
"blocks/servo/servo.js",
"blocks/Sharp_IR/Sharp_IR.js",
Expand Down
2 changes: 2 additions & 0 deletions blocks/blocks_colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Blockly.Blocks.mBot_3.HUE = "#33C7F2";
Blockly.Blocks.mBot_4.HUE = "#33C7F2";
Blockly.Blocks.mhk.HUE = "#FF6B37";
Blockly.Blocks.MRduino.HUE = "#2475FA";
Blockly.Blocks.MRduino2.HUE = "#2475FA";
Blockly.Blocks.multifunction.HUE = "#0152AB";
Blockly.Blocks.nrf24l01.HUE = "#0C0C0C";
Blockly.Blocks.null.HUE = "#00979D";
Expand All @@ -64,6 +65,7 @@ Blockly.Blocks.robuno.HUE = "#1A1BFF";
Blockly.Blocks.RoMeo1.HUE = "#F39800";
Blockly.Blocks.RoMeo2.HUE = "#F39800";
Blockly.Blocks.RoMeo3.HUE = "#F39800";
Blockly.Blocks.seeed_music_shield.HUE = "#8EC31F";
Blockly.Blocks.sensor_actuator.HUE = "#00979D";
Blockly.Blocks.servo.HUE = "#191919";
Blockly.Blocks.Sharp_IR.HUE = "#000000";
Expand Down
2 changes: 2 additions & 0 deletions blocks/blocks_typing.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ head.load(
"blocks/matrix-led-rgb-ws2812/blocks_typing.js",
"blocks/mbot/blocks_typing.js",
"blocks/MRduino/blocks_typing.js",
"blocks/MRduino2/blocks_typing.js",
"blocks/multi-function/blocks_typing.js",
"blocks/myhumankit/blocks_typing.js",
"blocks/peguino/blocks_typing.js",
Expand All @@ -46,6 +47,7 @@ head.load(
"blocks/robots/blocks_typing.js",
"blocks/robuno/blocks_typing.js",
"blocks/seeed/grove/blocks_typing.js",
"blocks/seeed/seeed_music_shield_2.2/blocks_typing.js",
"blocks/sensor_actuator/blocks_typing.js",
"blocks/servo/blocks_typing.js",
"blocks/Sharp_IR/blocks_typing.js",
Expand Down
9 changes: 9 additions & 0 deletions blocks/seeed/seeed_music_shield_2.2/blocks_typing.js
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 blocks/seeed/seeed_music_shield_2.2/seeed_music_shield_2.2.js
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/');
}
};

Loading

0 comments on commit 3e33ff7

Please sign in to comment.