mpy 外接传感增加旋转解码器
This commit is contained in:
@@ -2415,4 +2415,41 @@ export const get_keboards_value = {
|
||||
this.setOutput(true);
|
||||
this.setInputsInline(true);
|
||||
}
|
||||
}
|
||||
|
||||
export const init_init_rotary_encoder = {
|
||||
init:function(){
|
||||
this.setColour(SENSOR_EXTERN_HUE);
|
||||
this.appendValueInput('SUB')
|
||||
.appendField(Blockly.Msg.MIXLY_SETUP)
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_AS + Blockly.Msg.MIXLY_ROTARY_ENCODER)
|
||||
this.appendValueInput('PIN1')
|
||||
.appendField('PINA#')
|
||||
this.appendValueInput('PIN2')
|
||||
.appendField('PINB#')
|
||||
this.appendValueInput('KEY')
|
||||
.appendField('KEY#')
|
||||
this.appendValueInput('METHOD')
|
||||
.appendField(Blockly.Msg.MIXLY_DO)
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setInputsInline(true);
|
||||
}
|
||||
}
|
||||
|
||||
export const rotary_key = {
|
||||
init:function(){
|
||||
this.setColour(SENSOR_EXTERN_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_ROTARY_ENCODER)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.CLOCKWISE + Blockly.Msg.MIXLY_REVOLVE,"ROT_CW"],
|
||||
[Blockly.Msg.ANTI_CLOCKWISE + Blockly.Msg.MIXLY_REVOLVE,"ROT_CCW"],
|
||||
[Blockly.Msg.MIXLY_BUTTON2 + Blockly.Msg.MIXLY_BUTTON_PRESSED, "SW_PRESS"],
|
||||
[Blockly.Msg.MIXLY_BUTTON2 + Blockly.Msg.MIXLY_BUTTON_RELEASED,"SW_RELEASE"]
|
||||
]),"key")
|
||||
this.setOutput(true);
|
||||
this.setInputsInline(true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user