goog.provide('Blockly.Blocks.rotationservo');

goog.require('Blockly.Blocks');

Blockly.Blocks['servo_continuos_move'] = {
  //helpUrl: ('http://ardublock.ru/index.php?id=instrukciya-po-podklyucheniyu-servoprivod-rotarion'),
  init: function() {
    this.setColour(80);
	this.setInputsInline(true);
    this.appendDummyInput()
        .appendField(new Blockly.FieldImage("images/servorot.png",41,38))
		.appendField(Blockly.Msg.ROTSERVO_Servo)
        .appendField(Blockly.Msg.PIN)
        .appendField(new Blockly.FieldDropdown(profile.default.digital), "PIN");
	this.appendDummyInput()
		.appendField(Blockly.Msg.ROTSERVO_Direction)
		.appendField(new Blockly.FieldDropdown([['Forward', '1'],['Backward', '0']]), "SERVOMOTOR_DIR");
  	this.appendValueInput("SpeedServo")
        .setCheck('Number')
		.appendField(Blockly.Msg.ROTSERVO_Speed);
    this.setPreviousStatement(true, null);
    this.setNextStatement(true, null);
    this.setTooltip('');
	this.setHelpUrl(Blockly.Msg.servo_continuos_Url_1);
  }
};


Blockly.Blocks['servo_continuos_stop'] = {
  //helpUrl: ('http://ardublock.ru/index.php?id=instrukciya-po-podklyucheniyu-servoprivod-rotarion'),
  init: function() {
    this.setColour(80);
	this.setInputsInline(true);
    this.appendDummyInput()
		.appendField(new Blockly.FieldImage("images/servorot.png",41,38))
        .appendField(Blockly.Msg.ROTSERVO_Servo)
		.appendField(Blockly.Msg.PIN)
        .appendField(new Blockly.FieldDropdown(profile.default.digital), "PIN");
	this.appendDummyInput()
		.appendField(Blockly.Msg.ROTSERVO_Stop)
    this.setPreviousStatement(true, null);
    this.setNextStatement(true, null);
    this.setTooltip('');
	this.setHelpUrl(Blockly.Msg.servo_continuos_Url_1);
  }
};