初始化提交
This commit is contained in:
40
boards/default_src/python_mixpy/blocks/pins.js
Normal file
40
boards/default_src/python_mixpy/blocks/pins.js
Normal file
@@ -0,0 +1,40 @@
|
||||
import * as Blockly from 'blockly/core';
|
||||
import { Profile } from 'mixly';
|
||||
|
||||
const PINS_HUE = 230;
|
||||
|
||||
export const pins_digital_write = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.digital_write), 'PIN');
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_digital_read = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.digital_read), 'PIN');
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_analog_write = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.analog_write), 'PIN');
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_analog_read = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.analog_read), 'PIN');
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user