analogWrite works on PWM pins, not analog pins

zeedee
Nick Johnson 7 years ago
parent 43b8b03dbc
commit ab7ac906e3
  1. 826
      blockly/blockly_uncompressed.js
  2. 2
      blockly/blocks/base.js
  3. 2
      blockly/blocks_compressed.js

File diff suppressed because one or more lines are too long

@ -109,7 +109,7 @@ Blockly.Blocks['inout_analog_write'] = {
this.setColour(230);
this.appendDummyInput()
.appendField("AnalogWrite PIN#")
.appendField(new Blockly.FieldDropdown(profile.default.analog), "PIN");
.appendField(new Blockly.FieldDropdown(profile.default.digital), "PIN");
this.appendValueInput("NUM", 'Number')
.appendField("value")
.setCheck('Number');

@ -25,7 +25,7 @@ Blockly.Blocks.base_map={helpUrl:"http://arduino.cc/en/Reference/map",init:funct
Blockly.Blocks.inout_buildin_led={helpUrl:"http://arduino.cc/en/Reference/DigitalWrite",init:function(){this.setColour(190);this.appendDummyInput().appendField("Build-in LED Stat").appendField(new Blockly.FieldDropdown([["HIGH","HIGH"],["LOW","LOW"]]),"STAT");this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("light or off the build-in LED")}};
Blockly.Blocks.inout_digital_write={helpUrl:"http://arduino.cc/en/Reference/DigitalWrite",init:function(){this.setColour(230);this.appendDummyInput().appendField("DigitalWrite PIN#").appendField(new Blockly.FieldDropdown(profile["default"].digital),"PIN").appendField("Stat").appendField(new Blockly.FieldDropdown([["HIGH","HIGH"],["LOW","LOW"]]),"STAT");this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("Write digital value to a specific Port")}};
Blockly.Blocks.inout_digital_read={helpUrl:"http://arduino.cc/en/Reference/DigitalRead",init:function(){this.setColour(230);this.appendDummyInput().appendField("DigitalRead PIN#").appendField(new Blockly.FieldDropdown(profile["default"].digital),"PIN");this.setOutput(!0,"Boolean");this.setTooltip("")}};
Blockly.Blocks.inout_analog_write={helpUrl:"http://arduino.cc/en/Reference/AnalogWrite",init:function(){this.setColour(230);this.appendDummyInput().appendField("AnalogWrite PIN#").appendField(new Blockly.FieldDropdown(profile["default"].analog),"PIN");this.appendValueInput("NUM","Number").appendField("value").setCheck("Number");this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("Write analog value between 0 and 255 to a specific Port")}};
Blockly.Blocks.inout_analog_write={helpUrl:"http://arduino.cc/en/Reference/AnalogWrite",init:function(){this.setColour(230);this.appendDummyInput().appendField("AnalogWrite PIN#").appendField(new Blockly.FieldDropdown(profile["default"].digital),"PIN");this.appendValueInput("NUM","Number").appendField("value").setCheck("Number");this.setInputsInline(!0);this.setPreviousStatement(!0,null);this.setNextStatement(!0,null);this.setTooltip("Write analog value between 0 and 255 to a specific Port")}};
Blockly.Blocks.inout_analog_read={helpUrl:"http://arduino.cc/en/Reference/AnalogRead",init:function(){this.setColour(230);this.appendDummyInput().appendField("AnalogRead PIN#").appendField(new Blockly.FieldDropdown(profile["default"].analog),"PIN");this.setOutput(!0,"Number");this.setTooltip("Return value between 0 and 1024")}};
Blockly.Blocks.inout_highlow={helpUrl:"http://arduino.cc/en/Reference/Constants",init:function(){this.setColour(230);this.appendDummyInput().appendField(new Blockly.FieldDropdown([["HIGH","HIGH"],["LOW","LOW"]]),"BOOL");this.setOutput(!0,"Boolean");this.setTooltip("")}};
Blockly.Blocks.servo_move={helpUrl:"http://www.arduino.cc/playground/ComponentLib/servo",init:function(){this.setColour(190);this.appendDummyInput().appendField("Servo").appendField(new Blockly.FieldImage("http://www.seeedstudio.com/depot/images/product/a991.jpg",64,64)).appendField("PIN#").appendField(new Blockly.FieldDropdown(profile["default"].digital),"PIN");this.appendValueInput("DEGREE","Number").setCheck("Number").setAlign(Blockly.ALIGN_RIGHT).appendField("Degree (0~180)");this.appendValueInput("DELAY_TIME",

Loading…
Cancel
Save