Update(boards): micropython板卡下移除一些块的覆写
This commit is contained in:
@@ -84,21 +84,6 @@ export const inout_analog_write_set = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const inout_analog_read = {
|
|
||||||
init: function () {
|
|
||||||
this.setColour(BASE_HUE);
|
|
||||||
this.appendValueInput("PIN", Number)
|
|
||||||
.appendField(Blockly.Msg.MIXLY_MICROBIT_PY_STORAGE_GET)
|
|
||||||
.appendField(Blockly.Msg.MIXLY_Analog_PINMODEIN)
|
|
||||||
.setCheck(Number);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.MIXLY_ESP32_MACHINE_VALUE)
|
|
||||||
this.setInputsInline(true);
|
|
||||||
this.setOutput(true, Number);
|
|
||||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_INOUT_ANALOG_READ_TOOLTIP);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const inout_analog_atten = {
|
export const inout_analog_atten = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setColour(BASE_HUE);
|
this.setColour(BASE_HUE);
|
||||||
@@ -225,40 +210,6 @@ export const inout_analog_write_init = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const inout_analog_read_init = {
|
|
||||||
init: function () {
|
|
||||||
this.setColour(BASE_HUE);
|
|
||||||
// this.appendValueInput("PIN", Number)
|
|
||||||
// .appendField(Blockly.Msg.MIXLY_SETUP)
|
|
||||||
// .appendField("PWM"+Blockly.Msg.MIXLY_Analog_PINMODEOUT)
|
|
||||||
// .appendField('pwm')
|
|
||||||
// .setCheck(Number);
|
|
||||||
this.appendDummyInput("")
|
|
||||||
.appendField(Blockly.Msg.MIXLY_SETUP)
|
|
||||||
.appendField(new Blockly.FieldTextInput('adc#'), 'PIN_OBJ')
|
|
||||||
.appendField(Blockly.Msg.MIXLY_MICROPYTHON_AS)
|
|
||||||
this.appendDummyInput("")
|
|
||||||
.appendField(Blockly.Msg.MIXLY_Analog_PINMODEIN)
|
|
||||||
// .appendField('adc')
|
|
||||||
// .appendField(new Blockly.FieldDropdown(profile.default.adc_pin),"PIN")
|
|
||||||
this.appendValueInput("PIN", Number)
|
|
||||||
.appendField(Blockly.Msg.MIXLY_PIN)
|
|
||||||
.setCheck(Number);
|
|
||||||
this.setInputsInline(true);
|
|
||||||
this.setPreviousStatement(true, null);
|
|
||||||
this.setNextStatement(true, null);
|
|
||||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_INOUT_ANALOG_READ_INIT_TOOLTIP);
|
|
||||||
},
|
|
||||||
getVars: function () {
|
|
||||||
return [this.getFieldValue('PIN_OBJ') == 'adc#' ? null : this.getFieldValue('PIN_OBJ')];
|
|
||||||
},
|
|
||||||
renameVar: function (oldName, newName) {
|
|
||||||
if (Blockly.Names.equals(oldName, this.getFieldValue('PIN_OBJ'))) {
|
|
||||||
this.setTitleValue(newName, 'PIN_OBJ');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const inout_pin_pressed_init = {
|
export const inout_pin_pressed_init = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setColour(BASE_HUE);
|
this.setColour(BASE_HUE);
|
||||||
|
|||||||
@@ -48,15 +48,6 @@ export const inout_analog_write_set = function (_, generator) {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
//ok
|
|
||||||
export const inout_analog_read = function (_, generator) {
|
|
||||||
generator.definitions_['import_machine'] = 'import machine';
|
|
||||||
var dropdown_pin = generator.valueToCode(this, 'PIN', generator.ORDER_ATOMIC);
|
|
||||||
//generator.setups_['setup_input_'+dropdown_pin] = 'pinMode('+dropdown_pin+', INPUT);';
|
|
||||||
var code = dropdown_pin + '.read()';
|
|
||||||
return [code, generator.ORDER_ATOMIC];
|
|
||||||
}
|
|
||||||
|
|
||||||
//ok
|
//ok
|
||||||
export const inout_pin_pressed = function (_, generator) {
|
export const inout_pin_pressed = function (_, generator) {
|
||||||
generator.definitions_['import_machine'] = 'import machine';
|
generator.definitions_['import_machine'] = 'import machine';
|
||||||
@@ -98,15 +89,6 @@ export const inout_analog_write_init = function (_, generator) {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const inout_analog_read_init = function (_, generator) {
|
|
||||||
generator.definitions_['import_machine'] = 'import machine';
|
|
||||||
var pin_obj = this.getFieldValue('PIN_OBJ') || 'adc#';
|
|
||||||
var dropdown_pin = generator.valueToCode(this, 'PIN', generator.ORDER_ATOMIC);
|
|
||||||
var varName = (pin_obj == 'adc#') ? 'adc' + dropdown_pin : generator.variableDB_.getName(pin_obj, Blockly.Variables.NAME_TYPE);
|
|
||||||
var code = varName + ' = machine.ADC(machine.Pin(' + dropdown_pin + '))\n';
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const inout_analog_atten = function (_, generator) {
|
export const inout_analog_atten = function (_, generator) {
|
||||||
generator.definitions_['import_machine'] = 'import machine';
|
generator.definitions_['import_machine'] = 'import machine';
|
||||||
var dropdown_pin = generator.valueToCode(this, 'PIN', generator.ORDER_ATOMIC);
|
var dropdown_pin = generator.valueToCode(this, 'PIN', generator.ORDER_ATOMIC);
|
||||||
|
|||||||
@@ -81,21 +81,6 @@ export const inout_analog_write_set = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const inout_analog_read = {
|
|
||||||
init: function () {
|
|
||||||
this.setColour(BASE_HUE);
|
|
||||||
this.appendValueInput("PIN", Number)
|
|
||||||
.appendField(Blockly.Msg.MIXLY_MICROBIT_PY_STORAGE_GET)
|
|
||||||
.appendField(Blockly.Msg.MIXLY_Analog_PINMODEIN)
|
|
||||||
.setCheck(Number);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.MIXLY_ESP32_MACHINE_VALUE)
|
|
||||||
this.setInputsInline(true);
|
|
||||||
this.setOutput(true, Number);
|
|
||||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_INOUT_ANALOG_READ_TOOLTIP);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const inout_analog_atten = {
|
export const inout_analog_atten = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setColour(BASE_HUE);
|
this.setColour(BASE_HUE);
|
||||||
@@ -222,40 +207,6 @@ export const inout_analog_write_init = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const inout_analog_read_init = {
|
|
||||||
init: function () {
|
|
||||||
this.setColour(BASE_HUE);
|
|
||||||
// this.appendValueInput("PIN", Number)
|
|
||||||
// .appendField(Blockly.Msg.MIXLY_SETUP)
|
|
||||||
// .appendField("PWM"+Blockly.Msg.MIXLY_Analog_PINMODEOUT)
|
|
||||||
// .appendField('pwm')
|
|
||||||
// .setCheck(Number);
|
|
||||||
this.appendDummyInput("")
|
|
||||||
.appendField(Blockly.Msg.MIXLY_SETUP)
|
|
||||||
.appendField(new Blockly.FieldTextInput('adc#'), 'PIN_OBJ')
|
|
||||||
.appendField(Blockly.Msg.MIXLY_MICROPYTHON_AS)
|
|
||||||
this.appendDummyInput("")
|
|
||||||
.appendField(Blockly.Msg.MIXLY_Analog_PINMODEIN)
|
|
||||||
// .appendField('adc')
|
|
||||||
// .appendField(new Blockly.FieldDropdown(profile.default.adc_pin),"PIN")
|
|
||||||
this.appendValueInput("PIN", Number)
|
|
||||||
.appendField(Blockly.Msg.MIXLY_PIN)
|
|
||||||
.setCheck(Number);
|
|
||||||
this.setInputsInline(true);
|
|
||||||
this.setPreviousStatement(true, null);
|
|
||||||
this.setNextStatement(true, null);
|
|
||||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_INOUT_ANALOG_READ_INIT_TOOLTIP);
|
|
||||||
},
|
|
||||||
getVars: function () {
|
|
||||||
return [this.getFieldValue('PIN_OBJ') == 'adc#' ? null : this.getFieldValue('PIN_OBJ')];
|
|
||||||
},
|
|
||||||
renameVar: function (oldName, newName) {
|
|
||||||
if (Blockly.Names.equals(oldName, this.getFieldValue('PIN_OBJ'))) {
|
|
||||||
this.setTitleValue(newName, 'PIN_OBJ');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const inout_pin_pressed_init = {
|
export const inout_pin_pressed_init = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setColour(BASE_HUE);
|
this.setColour(BASE_HUE);
|
||||||
|
|||||||
@@ -48,15 +48,6 @@ export const inout_analog_write_set = function (_, generator) {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ok
|
|
||||||
export const inout_analog_read = function (_, generator) {
|
|
||||||
generator.definitions_['import_machine'] = 'import machine';
|
|
||||||
var dropdown_pin = generator.valueToCode(this, 'PIN', generator.ORDER_ATOMIC);
|
|
||||||
//generator.setups_['setup_input_'+dropdown_pin] = 'pinMode('+dropdown_pin+', INPUT);';
|
|
||||||
var code = dropdown_pin + '.read()';
|
|
||||||
return [code, generator.ORDER_ATOMIC];
|
|
||||||
}
|
|
||||||
|
|
||||||
// ok
|
// ok
|
||||||
export const inout_pin_pressed = function (_, generator) {
|
export const inout_pin_pressed = function (_, generator) {
|
||||||
generator.definitions_['import_machine'] = 'import machine';
|
generator.definitions_['import_machine'] = 'import machine';
|
||||||
@@ -98,15 +89,6 @@ export const inout_analog_write_init = function (_, generator) {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const inout_analog_read_init = function (_, generator) {
|
|
||||||
generator.definitions_['import_machine'] = 'import machine';
|
|
||||||
var pin_obj = this.getFieldValue('PIN_OBJ') || 'adc#';
|
|
||||||
var dropdown_pin = generator.valueToCode(this, 'PIN', generator.ORDER_ATOMIC);
|
|
||||||
var varName = (pin_obj == 'adc#') ? 'adc' + dropdown_pin : generator.variableDB_.getName(pin_obj, Blockly.Variables.NAME_TYPE);
|
|
||||||
var code = varName + ' = machine.ADC(machine.Pin(' + dropdown_pin + '))\n';
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const inout_analog_atten = function (_, generator) {
|
export const inout_analog_atten = function (_, generator) {
|
||||||
generator.definitions_['import_machine'] = 'import machine';
|
generator.definitions_['import_machine'] = 'import machine';
|
||||||
var dropdown_pin = generator.valueToCode(this, 'PIN', generator.ORDER_ATOMIC);
|
var dropdown_pin = generator.valueToCode(this, 'PIN', generator.ORDER_ATOMIC);
|
||||||
|
|||||||
@@ -81,21 +81,6 @@ export const inout_analog_write_set = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const inout_analog_read = {
|
|
||||||
init: function () {
|
|
||||||
this.setColour(BASE_HUE);
|
|
||||||
this.appendValueInput("PIN", Number)
|
|
||||||
.appendField(Blockly.Msg.MIXLY_MICROBIT_PY_STORAGE_GET)
|
|
||||||
.appendField(Blockly.Msg.MIXLY_Analog_PINMODEIN)
|
|
||||||
.setCheck(Number);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.MIXLY_ESP32_MACHINE_VALUE)
|
|
||||||
this.setInputsInline(true);
|
|
||||||
this.setOutput(true, Number);
|
|
||||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_INOUT_ANALOG_READ_TOOLTIP);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const inout_analog_atten = {
|
export const inout_analog_atten = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setColour(BASE_HUE);
|
this.setColour(BASE_HUE);
|
||||||
@@ -218,40 +203,6 @@ export const inout_analog_write_init = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const inout_analog_read_init = {
|
|
||||||
init: function () {
|
|
||||||
this.setColour(BASE_HUE);
|
|
||||||
// this.appendValueInput("PIN", Number)
|
|
||||||
// .appendField(Blockly.Msg.MIXLY_SETUP)
|
|
||||||
// .appendField("PWM"+Blockly.Msg.MIXLY_Analog_PINMODEOUT)
|
|
||||||
// .appendField('pwm')
|
|
||||||
// .setCheck(Number);
|
|
||||||
this.appendDummyInput("")
|
|
||||||
.appendField(Blockly.Msg.MIXLY_SETUP)
|
|
||||||
.appendField(new Blockly.FieldTextInput('adc#'), 'PIN_OBJ')
|
|
||||||
.appendField(Blockly.Msg.MIXLY_MICROPYTHON_AS)
|
|
||||||
this.appendDummyInput("")
|
|
||||||
.appendField(Blockly.Msg.MIXLY_Analog_PINMODEIN)
|
|
||||||
// .appendField('adc')
|
|
||||||
// .appendField(new Blockly.FieldDropdown(profile.default.adc_pin),"PIN")
|
|
||||||
this.appendValueInput("PIN", Number)
|
|
||||||
.appendField(Blockly.Msg.MIXLY_PIN)
|
|
||||||
.setCheck(Number);
|
|
||||||
this.setInputsInline(true);
|
|
||||||
this.setPreviousStatement(true, null);
|
|
||||||
this.setNextStatement(true, null);
|
|
||||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_INOUT_ANALOG_READ_INIT_TOOLTIP);
|
|
||||||
},
|
|
||||||
getVars: function () {
|
|
||||||
return [this.getFieldValue('PIN_OBJ') == 'adc#' ? null : this.getFieldValue('PIN_OBJ')];
|
|
||||||
},
|
|
||||||
renameVar: function (oldName, newName) {
|
|
||||||
if (Blockly.Names.equals(oldName, this.getFieldValue('PIN_OBJ'))) {
|
|
||||||
this.setTitleValue(newName, 'PIN_OBJ');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const inout_pin_pressed_init = {
|
export const inout_pin_pressed_init = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setColour(BASE_HUE);
|
this.setColour(BASE_HUE);
|
||||||
|
|||||||
@@ -48,15 +48,6 @@ export const inout_analog_write_set = function (_, generator) {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ok
|
|
||||||
export const inout_analog_read = function (_, generator) {
|
|
||||||
generator.definitions_['import_machine'] = 'import machine';
|
|
||||||
var dropdown_pin = generator.valueToCode(this, 'PIN', generator.ORDER_ATOMIC);
|
|
||||||
//generator.setups_['setup_input_'+dropdown_pin] = 'pinMode('+dropdown_pin+', INPUT);';
|
|
||||||
var code = dropdown_pin + '.read()';
|
|
||||||
return [code, generator.ORDER_ATOMIC];
|
|
||||||
}
|
|
||||||
|
|
||||||
// ok
|
// ok
|
||||||
export const inout_pin_pressed = function (_, generator) {
|
export const inout_pin_pressed = function (_, generator) {
|
||||||
generator.definitions_['import_machine'] = 'import machine';
|
generator.definitions_['import_machine'] = 'import machine';
|
||||||
@@ -98,15 +89,6 @@ export const inout_analog_write_init = function (_, generator) {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const inout_analog_read_init = function (_, generator) {
|
|
||||||
generator.definitions_['import_machine'] = 'import machine';
|
|
||||||
var pin_obj = this.getFieldValue('PIN_OBJ') || 'adc#';
|
|
||||||
var dropdown_pin = generator.valueToCode(this, 'PIN', generator.ORDER_ATOMIC);
|
|
||||||
var varName = (pin_obj == 'adc#') ? 'adc' + dropdown_pin : generator.variableDB_.getName(pin_obj, Blockly.Variables.NAME_TYPE);
|
|
||||||
var code = varName + ' = machine.ADC(machine.Pin(' + dropdown_pin + '))\n';
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const inout_analog_atten = function (_, generator) {
|
export const inout_analog_atten = function (_, generator) {
|
||||||
generator.definitions_['import_machine'] = 'import machine';
|
generator.definitions_['import_machine'] = 'import machine';
|
||||||
var dropdown_pin = generator.valueToCode(this, 'PIN', generator.ORDER_ATOMIC);
|
var dropdown_pin = generator.valueToCode(this, 'PIN', generator.ORDER_ATOMIC);
|
||||||
|
|||||||
@@ -81,21 +81,6 @@ export const inout_analog_write_set = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const inout_analog_read = {
|
|
||||||
init: function () {
|
|
||||||
this.setColour(BASE_HUE);
|
|
||||||
this.appendValueInput("PIN", Number)
|
|
||||||
.appendField(Blockly.Msg.MIXLY_MICROBIT_PY_STORAGE_GET)
|
|
||||||
.appendField(Blockly.Msg.MIXLY_Analog_PINMODEIN)
|
|
||||||
.setCheck(Number);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.MIXLY_ESP32_MACHINE_VALUE)
|
|
||||||
this.setInputsInline(true);
|
|
||||||
this.setOutput(true, Number);
|
|
||||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_INOUT_ANALOG_READ_TOOLTIP);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const inout_analog_atten = {
|
export const inout_analog_atten = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setColour(BASE_HUE);
|
this.setColour(BASE_HUE);
|
||||||
@@ -218,40 +203,6 @@ export const inout_analog_write_init = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const inout_analog_read_init = {
|
|
||||||
init: function () {
|
|
||||||
this.setColour(BASE_HUE);
|
|
||||||
// this.appendValueInput("PIN", Number)
|
|
||||||
// .appendField(Blockly.Msg.MIXLY_SETUP)
|
|
||||||
// .appendField("PWM"+Blockly.Msg.MIXLY_Analog_PINMODEOUT)
|
|
||||||
// .appendField('pwm')
|
|
||||||
// .setCheck(Number);
|
|
||||||
this.appendDummyInput("")
|
|
||||||
.appendField(Blockly.Msg.MIXLY_SETUP)
|
|
||||||
.appendField(new Blockly.FieldTextInput('adc#'), 'PIN_OBJ')
|
|
||||||
.appendField(Blockly.Msg.MIXLY_MICROPYTHON_AS)
|
|
||||||
this.appendDummyInput("")
|
|
||||||
.appendField(Blockly.Msg.MIXLY_Analog_PINMODEIN)
|
|
||||||
// .appendField('adc')
|
|
||||||
// .appendField(new Blockly.FieldDropdown(profile.default.adc_pin),"PIN")
|
|
||||||
this.appendValueInput("PIN", Number)
|
|
||||||
.appendField(Blockly.Msg.MIXLY_PIN)
|
|
||||||
.setCheck(Number);
|
|
||||||
this.setInputsInline(true);
|
|
||||||
this.setPreviousStatement(true, null);
|
|
||||||
this.setNextStatement(true, null);
|
|
||||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_INOUT_ANALOG_READ_INIT_TOOLTIP);
|
|
||||||
},
|
|
||||||
getVars: function () {
|
|
||||||
return [this.getFieldValue('PIN_OBJ') == 'adc#' ? null : this.getFieldValue('PIN_OBJ')];
|
|
||||||
},
|
|
||||||
renameVar: function (oldName, newName) {
|
|
||||||
if (Blockly.Names.equals(oldName, this.getFieldValue('PIN_OBJ'))) {
|
|
||||||
this.setTitleValue(newName, 'PIN_OBJ');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const inout_pin_pressed_init = {
|
export const inout_pin_pressed_init = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setColour(BASE_HUE);
|
this.setColour(BASE_HUE);
|
||||||
|
|||||||
@@ -48,15 +48,6 @@ export const inout_analog_write_set = function (_, generator) {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ok
|
|
||||||
export const inout_analog_read = function (_, generator) {
|
|
||||||
generator.definitions_['import_machine'] = 'import machine';
|
|
||||||
var dropdown_pin = generator.valueToCode(this, 'PIN', generator.ORDER_ATOMIC);
|
|
||||||
//generator.setups_['setup_input_'+dropdown_pin] = 'pinMode('+dropdown_pin+', INPUT);';
|
|
||||||
var code = dropdown_pin + '.read()';
|
|
||||||
return [code, generator.ORDER_ATOMIC];
|
|
||||||
}
|
|
||||||
|
|
||||||
// ok
|
// ok
|
||||||
export const inout_pin_pressed = function (_, generator) {
|
export const inout_pin_pressed = function (_, generator) {
|
||||||
generator.definitions_['import_machine'] = 'import machine';
|
generator.definitions_['import_machine'] = 'import machine';
|
||||||
@@ -98,15 +89,6 @@ export const inout_analog_write_init = function (_, generator) {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const inout_analog_read_init = function (_, generator) {
|
|
||||||
generator.definitions_['import_machine'] = 'import machine';
|
|
||||||
var pin_obj = this.getFieldValue('PIN_OBJ') || 'adc#';
|
|
||||||
var dropdown_pin = generator.valueToCode(this, 'PIN', generator.ORDER_ATOMIC);
|
|
||||||
var varName = (pin_obj == 'adc#') ? 'adc' + dropdown_pin : generator.variableDB_.getName(pin_obj, Blockly.Variables.NAME_TYPE);
|
|
||||||
var code = varName + ' = machine.ADC(machine.Pin(' + dropdown_pin + '))\n';
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const inout_analog_atten = function (_, generator) {
|
export const inout_analog_atten = function (_, generator) {
|
||||||
generator.definitions_['import_machine'] = 'import machine';
|
generator.definitions_['import_machine'] = 'import machine';
|
||||||
var dropdown_pin = generator.valueToCode(this, 'PIN', generator.ORDER_ATOMIC);
|
var dropdown_pin = generator.valueToCode(this, 'PIN', generator.ORDER_ATOMIC);
|
||||||
|
|||||||
Reference in New Issue
Block a user