Blockly.Blocks['sendtoarduino'] = {
  init: function() {
    this.appendValueInput("MESSAGE")
        .setCheck("String")
        .appendField("Envoyer à l'arduino :");
    this.setPreviousStatement(true, null);
    this.setNextStatement(true, null);
    this.setColour(330);
 this.setTooltip("envoi d'un string à l'Arduino de la maquette");
 this.setHelpUrl("");
  }
};

Blockly.Blocks['turn_led'] = {
  init: function() {
    this.appendDummyInput()
        .appendField("Mettre la LED en l'état")
        .appendField(new Blockly.FieldDropdown([["allumée","on"], ["éteinte","off"]]), "val");
    this.setPreviousStatement(true, null);
    this.setNextStatement(true, null);
    this.setColour(345);
 this.setTooltip("Change l'état d'une LED");
 this.setHelpUrl("");
  }
};

Blockly.Blocks['arduino_wait'] = {
  init: function() {
    this.appendValueInput("time")
        .setCheck("Number")
        .appendField("Attendre");
    this.appendDummyInput()
        .appendField("secondes");
    this.setInputsInline(true);
    this.setPreviousStatement(true, null);
    this.setNextStatement(true, null);
    this.setColour(330);
 this.setTooltip("");
 this.setHelpUrl("");
  }
};
