mini板 模拟键盘鼠标字符输入
+所有板增加获取主控id +所有板修改初始化LTR390UV
This commit is contained in:
@@ -999,3 +999,208 @@ export const set_all_power_output = {
|
||||
this.setTooltip(Blockly.Msg.MIXLY_MIXBOT_MOTOR_EXTERN_TOOLTIP);
|
||||
}
|
||||
}
|
||||
|
||||
export const analog_keyboard_input = {
|
||||
init: function () {
|
||||
this.setColour(ACTUATOR_ONBOARD_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.ANALOG+Blockly.Msg.MIXLY_KEYBOARD_INPUT);
|
||||
this.appendValueInput('special')
|
||||
.appendField(Blockly.Msg.MIXLY_SPECIAL_KEY);
|
||||
this.appendValueInput('general')
|
||||
.appendField(Blockly.Msg.MIXLY_GENERAL_KEY);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_RELEASE)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MICROPYTHON_DISPLAY_YES, "True"],
|
||||
[Blockly.Msg.MICROPYTHON_DISPLAY_NO, "False"]
|
||||
]),'release');
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setInputsInline(true);
|
||||
this.setTooltip(Blockly.Msg.ANALOG + Blockly.Msg.MIXLY_KEYBOARD_INPUT);
|
||||
}
|
||||
};
|
||||
|
||||
export const special_key = {
|
||||
init: function () {
|
||||
this.setColour(ACTUATOR_ONBOARD_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MIXLY_SPECIAL_KEY0,"0"],
|
||||
[Blockly.Msg.MIXLY_SPECIAL_KEY1, "1"],
|
||||
[Blockly.Msg.MIXLY_SPECIAL_KEY2, "2"],
|
||||
[Blockly.Msg.MIXLY_SPECIAL_KEY1, "4"],
|
||||
[Blockly.Msg.MIXLY_SPECIAL_KEY8, "8"],
|
||||
[Blockly.Msg.MIXLY_SPECIAL_KEY16, "16"],
|
||||
[Blockly.Msg.MIXLY_SPECIAL_KEY32, "32"],
|
||||
[Blockly.Msg.MIXLY_SPECIAL_KEY64, "64"],
|
||||
[Blockly.Msg.MIXLY_SPECIAL_KEY128, "128"]
|
||||
]), 'op')
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const general_key = {
|
||||
init: function () {
|
||||
this.setColour(ACTUATOR_ONBOARD_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MIXLY_SPECIAL_KEY0,"0"],
|
||||
['A', "0x04"],
|
||||
['B', "0x05"],
|
||||
['C', "0x06"],
|
||||
['D', "0x07"],
|
||||
['E', "0x08"],
|
||||
['F', "0x09"],
|
||||
['G', "0x0A"],
|
||||
['H', "0x0B"],
|
||||
['I', "0x0C"],
|
||||
['J', "0x0D"],
|
||||
['K', "0x0E"],
|
||||
['L', "0x0F"],
|
||||
['M', "0x10"],
|
||||
['N', "0x11"],
|
||||
['O', "0x12"],
|
||||
['P', "0x13"],
|
||||
['Q', "0x14"],
|
||||
['R', "0x15"],
|
||||
['S', "0x16"],
|
||||
['T', "0x17"],
|
||||
['U', "0x18"],
|
||||
['V', "0x19"],
|
||||
['W', "0x1A"],
|
||||
['X', "0x1B"],
|
||||
['Y', "0x1C"],
|
||||
['Z', "0x1D"],
|
||||
['ONE', "0x1E"],
|
||||
['TWO', "0x1F"],
|
||||
['THREE', "0x20"],
|
||||
['FOUR', "0x21"],
|
||||
['FIVE', "0x22"],
|
||||
['SIX', "0x23"],
|
||||
['SEVEN', "0x24"],
|
||||
['EIGHT', "0x25"],
|
||||
['NINE', "0x26"],
|
||||
['ZERO', "0x27"],
|
||||
['ENTER', "0x28"],
|
||||
['ESC', "0x29"],
|
||||
['BACKSPACE', "0x2A"],
|
||||
['TAB', "0x2B"],
|
||||
['SPACE', "0x2C"],
|
||||
['MINUS', "0x2D"],
|
||||
['EQUAL', "0x2E"],
|
||||
['LEFT_BRACE', "0x2F"],
|
||||
['RIGHT_BRACE', "0x30"],
|
||||
['BACKSLASH', "0x31"],
|
||||
['SEMICOLON', "0x33"],
|
||||
['QUOTE', "0x34"],
|
||||
['TILDE', "0x35"],
|
||||
['COMMA', "0x36"],
|
||||
['PERIOD', "0x37"],
|
||||
['SLASH', "0x38"],
|
||||
['CAPS_LOCK', "0x39"],
|
||||
['F1', "0x3A"],
|
||||
['F2', "0x3B"],
|
||||
['F3', "0x3C"],
|
||||
['F4', "0x3D"],
|
||||
['F5', "0x3E"],
|
||||
['F6', "0x3F"],
|
||||
['F7', "0x40"],
|
||||
['F8', "0x41"],
|
||||
['F9', "0x42"],
|
||||
['F10', "0x43"],
|
||||
['F11', "0x44"],
|
||||
['F12', "0x45"],
|
||||
['PRINTSCREEN', "0x46"],
|
||||
['SCROLL_LOCK', "0x47"],
|
||||
['PAUSE', "0x48"],
|
||||
['INSERT', "0x49"],
|
||||
['HOME', "0x4A"],
|
||||
['PAGE_UP', "0x4B"],
|
||||
['DELETE', "0x4C"],
|
||||
['END', "0x4D"],
|
||||
['PAGE_DOWN', "0x4E"],
|
||||
['RIGHT', "0x4F"],
|
||||
['LEFT', "0x50"],
|
||||
['DOWN', "0x51"],
|
||||
['UP', "0x52"],
|
||||
['NUM_LOCK', "0x53"],
|
||||
['NUMPAD_SLASH', "0x54"],
|
||||
['NUMPAD_ASTERISK', "0x55"],
|
||||
['NUMPAD_MINUS', "0x56"],
|
||||
['NUMPAD_PLUS', "0x57"],
|
||||
['NUMPAD_ENTER', "0x58"],
|
||||
['NUMPAD_1', "0x59"],
|
||||
['NUMPAD_2', "0x5A"],
|
||||
['NUMPAD_3', "0x5B"],
|
||||
['NUMPAD_4', "0x5C"],
|
||||
['NUMPAD_5', "0x5D"],
|
||||
['NUMPAD_6', "0x5E"],
|
||||
['NUMPAD_7', "0x5F"],
|
||||
['NUMPAD_8', "0x60"],
|
||||
['NUMPAD_9', "0x61"],
|
||||
['NUMPAD_0', "0x62"],
|
||||
['NUMPAD_PERIOD', "0x63"]
|
||||
]), 'op')
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
export const analog_mouse_input = {
|
||||
init: function () {
|
||||
this.setColour(ACTUATOR_ONBOARD_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.ANALOG+Blockly.Msg.MIXLY_MOUSE_INPUT);
|
||||
this.appendValueInput('key')
|
||||
.appendField(Blockly.Msg.MIXLY_MOUSE_KEYS);
|
||||
this.appendValueInput('x')
|
||||
.appendField(Blockly.Msg.MIXLY_X_Y_CHANGES+'x:');
|
||||
this.appendValueInput('y')
|
||||
.appendField('y:');
|
||||
this.appendValueInput('wheel')
|
||||
.appendField(Blockly.Msg.MIXLY_WHEEL_CHANGES);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_RELEASE)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MICROPYTHON_DISPLAY_YES, "True"],
|
||||
[Blockly.Msg.MICROPYTHON_DISPLAY_NO, "False"]
|
||||
]),'release');
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setInputsInline(true);
|
||||
this.setTooltip(Blockly.Msg.ANALOG + Blockly.Msg.MIXLY_KEYBOARD_INPUT);
|
||||
}
|
||||
};
|
||||
|
||||
export const mouse_key = {
|
||||
init: function () {
|
||||
this.setColour(ACTUATOR_ONBOARD_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MIXLY_SPECIAL_KEY0,"0"],
|
||||
[Blockly.Msg.MIXLY_MOUSE_LEFT_KEY, "1"],
|
||||
[Blockly.Msg.MIXLY_MOUSE_RIGHT_KEY, "2"],
|
||||
[Blockly.Msg.MIXLY_MOUSE_MID_KEY, "4"]
|
||||
]), 'op')
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const analog_keyboard_str = {
|
||||
init:function(){
|
||||
this.setColour(ACTUATOR_ONBOARD_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.ANALOG+Blockly.Msg.MIXLY_KEYBOARD_INPUT);
|
||||
this.appendValueInput('str')
|
||||
.appendField(Blockly.Msg.MIXLY_STR_PRINT);
|
||||
this.appendValueInput('time')
|
||||
.appendField(Blockly.Msg.MIXLY_STR_PRINT_TIME_DELAY);
|
||||
this.appendDummyInput()
|
||||
.appendField('ms');
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setInputsInline(true);
|
||||
}
|
||||
}
|
||||
@@ -349,6 +349,7 @@ export const sensor_use_i2c_init = {
|
||||
["ADXL345", "ADXL345"],
|
||||
["LTR308", "LTR308"],
|
||||
["LTR381RGB", "LTR381RGB"],
|
||||
["LTR390UV","LTR390UV"],
|
||||
["HP203X", "HP203X"],
|
||||
["SHTC3", "SHTC3"],
|
||||
["AHT21", "AHT21"],
|
||||
|
||||
@@ -443,3 +443,49 @@ export const set_all_power_output = function (_, generator) {
|
||||
var code = 'onboard_bot.usben(freq = ' + duty + ')\n';
|
||||
return code;
|
||||
}
|
||||
|
||||
export const analog_keyboard_input = function (_, generator) {
|
||||
var version = Boards.getSelectedBoardKey().split(':')[2]
|
||||
var sp = generator.valueToCode(this, 'special', generator.ORDER_ATOMIC);
|
||||
var ge = generator.valueToCode(this, 'general', generator.ORDER_ATOMIC);
|
||||
var re = this.getFieldValue('release');
|
||||
generator.definitions_['import_' + version + '_onboard_bot'] = 'from ' + version + ' import onboard_bot';
|
||||
var code = "hid_keyboard(special="+sp+",general="+ge+",release="+re+")\n";
|
||||
return code;
|
||||
}
|
||||
|
||||
export const special_key = function (_, generator) {
|
||||
var code = this.getFieldValue('op');
|
||||
return [code, generator.ORDER_ATOMIC];
|
||||
}
|
||||
|
||||
export const general_key = function (_, generator) {
|
||||
var code = this.getFieldValue('op');
|
||||
return [code, generator.ORDER_ATOMIC];
|
||||
}
|
||||
|
||||
export const analog_mouse_input = function (_, generator) {
|
||||
var version = Boards.getSelectedBoardKey().split(':')[2]
|
||||
var key = generator.valueToCode(this, 'key', generator.ORDER_ATOMIC);
|
||||
var x = generator.valueToCode(this, 'x', generator.ORDER_ATOMIC);
|
||||
var y = generator.valueToCode(this, 'y', generator.ORDER_ATOMIC);
|
||||
var wheel = generator.valueToCode(this, 'wheel', generator.ORDER_ATOMIC);
|
||||
var re = this.getFieldValue('release');
|
||||
generator.definitions_['import_' + version + '_onboard_bot'] = 'from ' + version + ' import onboard_bot';
|
||||
var code = "hid_mouse(keys="+key+",move=("+x+","+y+"),wheel="+wheel+",release="+re+")\n";
|
||||
return code;
|
||||
}
|
||||
|
||||
export const mouse_key = function (_, generator) {
|
||||
var code = this.getFieldValue('op');
|
||||
return [code, generator.ORDER_ATOMIC];
|
||||
}
|
||||
|
||||
export const analog_keyboard_str = function (_, generator) {
|
||||
var version = Boards.getSelectedBoardKey().split(':')[2]
|
||||
var str = generator.valueToCode(this, 'str', generator.ORDER_ATOMIC);
|
||||
var t = generator.valueToCode(this, 'time', generator.ORDER_ATOMIC);
|
||||
generator.definitions_['import_' + version + '_onboard_bot'] = 'from ' + version + ' import onboard_bot';
|
||||
var code = "onboard_bot.hid_keyboard_str("+str+",delay="+t+")\n";
|
||||
return code;
|
||||
}
|
||||
@@ -175,10 +175,13 @@ export const sensor_use_i2c_init = function (_, generator) {
|
||||
code = v + ' = adxl345.' + key + "(" + iv + ')\n';
|
||||
} else if (key == 'LTR308') {
|
||||
generator.definitions_['import_ltr308al'] = 'import ltr308al';
|
||||
code = v + ' = ltr308al.LTR_308ALS(' + iv + ')\n';
|
||||
code = v + ' = ltr308al.LTR308ALS(' + iv + ')\n';
|
||||
} else if (key == 'LTR381RGB') {
|
||||
generator.definitions_['import_ltr381rgb'] = 'import ltr381rgb';
|
||||
code = v + ' = ltr381rgb.LTR_381RGB(' + iv + ')\n';
|
||||
}else if (key == 'LTR390UV'){
|
||||
generator.definitions_['import_ltr390uv'] = 'import ltr390uv';
|
||||
code = v + ' = ltr390uv.ALS_UVS(' + iv +')\n';
|
||||
} else if (key == 'HP203X') {
|
||||
generator.definitions_['import_hp203x'] = 'import hp203x';
|
||||
code = v + ' = hp203x.HP203X(' + iv + ')\n';
|
||||
|
||||
@@ -306,6 +306,7 @@
|
||||
<block type="garbage_collection"></block>
|
||||
<block type="get_mem_alloc"></block>
|
||||
<block type="get_mem_free"></block>
|
||||
<block type="get_unique_identifier"></block>
|
||||
</category>
|
||||
<category id="catMath" colour="230">
|
||||
<block type="math_number"></block>
|
||||
@@ -6637,6 +6638,18 @@
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="urequests_connect_url">
|
||||
<value name="url">
|
||||
<block type="urequests_wifi_url">
|
||||
<value name="URL">
|
||||
<shadow type="text">
|
||||
<field name="TEXT">url</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
<block type="urequests_response"></block>
|
||||
</category>
|
||||
|
||||
<category id="catFactory" name="Factory" colour="#777777">
|
||||
|
||||
@@ -18,6 +18,9 @@ _BOT035_PWM = const(0x0B)
|
||||
_BOT035_FLAG = const(0x0F)
|
||||
_BOT035_LEDS = const(0x10)
|
||||
_BOT035_PGA = const(0x20)
|
||||
_BOT035_KB = const(0x1C)
|
||||
_BOT035_MS = const(0x20)
|
||||
_BOT035_STR = const(0x24)
|
||||
_FONT_W = const(5)
|
||||
_FONT_H = const(8)
|
||||
_LEDS_W = const(12)
|
||||
@@ -135,7 +138,7 @@ class BOT035(FrameBuffer):
|
||||
self._buffer[i] = self._buffer[i] | buffer[i]
|
||||
|
||||
def _ascall_bitmap(self, buffer, x=0):
|
||||
if -_FONT_W <= x <= _LEDS_W:
|
||||
if -_FONT_W <= x <= _LEDS_W and buffer is not None:
|
||||
for _x in range(_FONT_W):
|
||||
for _y in range(_FONT_H):
|
||||
if (buffer[_x] >> _y) & 0x1:
|
||||
@@ -143,7 +146,7 @@ class BOT035(FrameBuffer):
|
||||
|
||||
def _uincode_bitmap(self, buffer, x=0):
|
||||
_buffer, width = buffer
|
||||
if -width < x < _LEDS_H:
|
||||
if -width < x < _LEDS_H and _buffer is not None:
|
||||
for _y in range(12):
|
||||
for _x in range(width):
|
||||
if _buffer[_y * ((width + 7) // 8) + _x // 8] & (0x80 >> (_x & 7)):
|
||||
@@ -221,6 +224,7 @@ class BOT035(FrameBuffer):
|
||||
def reset(self):
|
||||
"""Reset SPK, PWM registers to default state"""
|
||||
self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_SPK, b'\x0A\x00\x00\x00\x20\x4E\x64\x64')
|
||||
self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_KB, bytes(9))
|
||||
|
||||
def get_brightness(self):
|
||||
return self._brightness
|
||||
@@ -278,6 +282,36 @@ class BOT035(FrameBuffer):
|
||||
values = sorted(values)
|
||||
return values[-10] - values[10]
|
||||
|
||||
def hid_keyboard(self, special=0, general=0, release=True):
|
||||
self._buf = bytearray(4)
|
||||
self._buf[0] = special
|
||||
if type(general) is int:
|
||||
self._buf[1] = general
|
||||
elif type(general) is tuple:
|
||||
for i in range(len(general)):
|
||||
self._buf[i + 1] = general[i]
|
||||
self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_KB, self._buf)
|
||||
if release:
|
||||
time.sleep_ms(10)
|
||||
self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_KB, bytes(4))
|
||||
|
||||
def hid_keyboard_str(self, string, delay=0):
|
||||
for char in str(string):
|
||||
self._wreg(_BOT035_STR, ord(char))
|
||||
time.sleep_ms(20 + delay)
|
||||
|
||||
def hid_mouse(self, keys=0, move=(0, 0), wheel=0, release=True):
|
||||
self._buf = bytearray(4)
|
||||
self._buf[0] = keys
|
||||
self._buf[1] = move[0]
|
||||
self._buf[2] = move[1]
|
||||
self._buf[3] = wheel
|
||||
self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_MS, self._buf)
|
||||
if release:
|
||||
time.sleep_ms(10)
|
||||
self._i2c.writeto_mem(_BOT035_ADDRESS, _BOT035_MS, bytes(4))
|
||||
|
||||
|
||||
"""Graph module"""
|
||||
HEART=b'\x00\x0c\x1e?~\xfc~?\x1e\x0c\x00\x00'
|
||||
HEART_SMALL=b'\x00\x00\x0c\x1e<x<\x1e\x0c\x00\x00\x00'
|
||||
|
||||
@@ -281,6 +281,7 @@
|
||||
<block type="garbage_collection"></block>
|
||||
<block type="get_mem_alloc"></block>
|
||||
<block type="get_mem_free"></block>
|
||||
<block type="get_unique_identifier"></block>
|
||||
</category>
|
||||
<category id="catMath" colour="230">
|
||||
<block type="math_number"></block>
|
||||
@@ -1700,6 +1701,45 @@
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="analog_keyboard_input" m-show="micropython:esp32c2:mixgo_mini">
|
||||
<value name="special">
|
||||
<shadow type="special_key">
|
||||
</shadow>
|
||||
</value>
|
||||
<value name="general">
|
||||
<shadow type="general_key">
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="analog_mouse_input" m-show="micropython:esp32c2:mixgo_mini">
|
||||
<value name="key">
|
||||
<shadow type="mouse_key">
|
||||
</shadow>
|
||||
</value>
|
||||
<value name="x">
|
||||
<shadow type="math_number">
|
||||
</shadow>
|
||||
</value>
|
||||
<value name="y">
|
||||
<shadow type="math_number">
|
||||
</shadow>
|
||||
</value>
|
||||
<value name="wheel">
|
||||
<shadow type="math_number">
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="analog_keyboard_str" m-show="micropython:esp32c2:mixgo_mini">;
|
||||
<value name="str">
|
||||
<shadow type="text">
|
||||
<field name="TEXT">Hello, Mixly!</field>
|
||||
</shadow>
|
||||
</value>
|
||||
<value name="time">
|
||||
<shadow type="math_number">
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
</category>
|
||||
<category id="catOnBoardDisplay" name="catOnBoardDisplay" colour='#569A98'
|
||||
m-hide='micropython:esp32c3:generic micropython:esp32c3:mixgocar_c3'>
|
||||
|
||||
@@ -281,6 +281,7 @@
|
||||
<block type="garbage_collection"></block>
|
||||
<block type="get_mem_alloc"></block>
|
||||
<block type="get_mem_free"></block>
|
||||
<block type="get_unique_identifier"></block>
|
||||
</category>
|
||||
<category id="catMath" colour="230">
|
||||
<block type="math_number"></block>
|
||||
@@ -6449,6 +6450,18 @@
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="urequests_connect_url">
|
||||
<value name="url">
|
||||
<block type="urequests_wifi_url">
|
||||
<value name="URL">
|
||||
<shadow type="text">
|
||||
<field name="TEXT">url</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
<block type="urequests_response"></block>
|
||||
</category>
|
||||
|
||||
<category id="catFactory" name="Factory" colour="#777777">
|
||||
|
||||
@@ -306,6 +306,7 @@
|
||||
<block type="garbage_collection"></block>
|
||||
<block type="get_mem_alloc"></block>
|
||||
<block type="get_mem_free"></block>
|
||||
<block type="get_unique_identifier"></block>
|
||||
</category>
|
||||
<category id="catMath" colour="230">
|
||||
<block type="math_number"></block>
|
||||
@@ -6305,6 +6306,18 @@
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="urequests_connect_url">
|
||||
<value name="url">
|
||||
<block type="urequests_wifi_url">
|
||||
<value name="URL">
|
||||
<shadow type="text">
|
||||
<field name="TEXT">url</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
<block type="urequests_response"></block>
|
||||
</category>
|
||||
|
||||
<category id="catFactory" name="Factory" colour="#777777">
|
||||
|
||||
@@ -306,6 +306,7 @@
|
||||
<block type="garbage_collection"></block>
|
||||
<block type="get_mem_alloc"></block>
|
||||
<block type="get_mem_free"></block>
|
||||
<block type="get_unique_identifier"></block>
|
||||
</category>
|
||||
<category id="catMath" colour="230">
|
||||
<block type="math_number"></block>
|
||||
@@ -6929,6 +6930,18 @@
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="urequests_connect_url">
|
||||
<value name="url">
|
||||
<block type="urequests_wifi_url">
|
||||
<value name="URL">
|
||||
<shadow type="text">
|
||||
<field name="TEXT">url</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
<block type="urequests_response"></block>
|
||||
</category>
|
||||
|
||||
<category id="catFactory" name="Factory" colour="#777777">
|
||||
|
||||
@@ -272,7 +272,7 @@
|
||||
<block type="garbage_collection"></block>
|
||||
<block type="get_mem_alloc"></block>
|
||||
<block type="get_mem_free"></block>
|
||||
|
||||
<block type="get_unique_identifier"></block>
|
||||
</category>
|
||||
|
||||
<category id="catMath" colour="230">
|
||||
@@ -1981,6 +1981,18 @@
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="urequests_connect_url">
|
||||
<value name="url">
|
||||
<block type="urequests_wifi_url">
|
||||
<value name="URL">
|
||||
<shadow type="text">
|
||||
<field name="TEXT">url</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
<block type="urequests_response"></block>
|
||||
|
||||
</category>
|
||||
|
||||
|
||||
@@ -293,6 +293,7 @@
|
||||
<block type="garbage_collection"></block>
|
||||
<block type="get_mem_alloc"></block>
|
||||
<block type="get_mem_free"></block>
|
||||
<block type="get_unique_identifier"></block>
|
||||
</category>
|
||||
<category id="catMath" colour="230">
|
||||
<block type="math_number"></block>
|
||||
@@ -5622,6 +5623,18 @@
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
<block type="urequests_connect_url">
|
||||
<value name="url">
|
||||
<block type="urequests_wifi_url">
|
||||
<value name="URL">
|
||||
<shadow type="text">
|
||||
<field name="TEXT">url</field>
|
||||
</shadow>
|
||||
</value>
|
||||
</block>
|
||||
</value>
|
||||
</block>
|
||||
<block type="urequests_response"></block>
|
||||
</category>
|
||||
|
||||
<category id="catFactory" name="Factory" colour="#777777">
|
||||
|
||||
@@ -1018,5 +1018,16 @@ export const get_mem_free = {
|
||||
}
|
||||
};
|
||||
|
||||
export const get_unique_identifier = {
|
||||
init: function () {
|
||||
this.setColour(LOOPS_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_GET + Blockly.Msg.MIXLY_DEVICE +'ID');
|
||||
this.setInputsInline(true);
|
||||
this.setOutput(true);
|
||||
this.setTooltip(Blockly.Msg.PROCEDURES_DEFRETURN_RETURN + Blockly.Msg.MIXLY_GET_UNIQUE_IDEN);
|
||||
}
|
||||
};
|
||||
|
||||
// export const base_type = controls_type;
|
||||
// export const controls_TypeLists = controls_typeLists;
|
||||
@@ -271,5 +271,11 @@ export const get_mem_free = function (_, generator) {
|
||||
return [code, generator.ORDER_ATOMIC]
|
||||
}
|
||||
|
||||
export const get_unique_identifier = function (_, generator) {
|
||||
generator.definitions_['import_machine'] = 'import machine';
|
||||
var code = 'machine.unique_id()';
|
||||
return [code, generator.ORDER_ATOMIC];
|
||||
}
|
||||
|
||||
// ok
|
||||
export const controls_repeat = controls_repeat_ext;
|
||||
@@ -3636,4 +3636,27 @@ En.MIXLY_ESP32_CONNECT_URL_TOOLTIP = "initiate a network request";
|
||||
En.MIXLY_ESP32_UREQUESTS_URL_TOOLTIP = "initiate a network request through the API URL";
|
||||
En.MIXLY_ESP32_URL_REPONSE = "API return data";
|
||||
En.MIXLY_ESP32_URL_REPONSE_TOOLTIP = "get the data returned by the API";
|
||||
En.MIXLY_GET_UNIQUE_IDEN = "Obtain the unique identifier of the main control board";
|
||||
En.MIXLY_KEYBOARD_INPUT = "keyboard input";
|
||||
En.MIXLY_SPECIAL_KEY = "special key";
|
||||
En.MIXLY_GENERAL_KEY = "general key";
|
||||
En.MIXLY_RELEASE = "automatic release";
|
||||
En.MIXLY_SPECIAL_KEY0 = "no operation (release)";
|
||||
En.MIXLY_SPECIAL_KEY1 = "Left Control key";
|
||||
En.MIXLY_SPECIAL_KEY2 = "Left Shift key";
|
||||
En.MIXLY_SPECIAL_KEY4 = "Left Alt key";
|
||||
En.MIXLY_SPECIAL_KEY8 = "Left Windows key";
|
||||
En.MIXLY_SPECIAL_KEY16 = "Right Control key";
|
||||
En.MIXLY_SPECIAL_KEY32 = "Right Shift key";
|
||||
En.MIXLY_SPECIAL_KEY64 = "Right Alt key";
|
||||
En.MIXLY_SPECIAL_KEY128 = "Right Windows key";
|
||||
En.MIXLY_MOUSE_INPUT = "mouse input";
|
||||
En.MIXLY_MOUSE_KEYS = "mouse button";
|
||||
En.MIXLY_X_Y_CHANGES = "change in the x and y axes ";
|
||||
En.MIXLY_MOUSE_LEFT_KEY = "left key";
|
||||
En.MIXLY_MOUSE_RIGHT_KEY = "right key";
|
||||
En.MIXLY_MOUSE_MID_KEY = "middle key";
|
||||
En.MIXLY_WHEEL_CHANGES = "roller change amount";
|
||||
En.MIXLY_STR_PRINT = "character input";
|
||||
En.MIXLY_STR_PRINT_TIME_DELAY = "per character interval";
|
||||
})();
|
||||
@@ -3784,4 +3784,27 @@ ZhHans.MIXLY_ESP32_CONNECT_URL_TOOLTIP = "发起网络请求";
|
||||
ZhHans.MIXLY_ESP32_UREQUESTS_URL_TOOLTIP = "通过API的URL发起网络请求";
|
||||
ZhHans.MIXLY_ESP32_URL_REPONSE = "API返回数据";
|
||||
ZhHans.MIXLY_ESP32_URL_REPONSE_TOOLTIP = "获得API返回的数据";
|
||||
ZhHans.MIXLY_GET_UNIQUE_IDEN = "获取主控板的唯一标识";
|
||||
ZhHans.MIXLY_KEYBOARD_INPUT = "键盘输入";
|
||||
ZhHans.MIXLY_SPECIAL_KEY = "特殊按键";
|
||||
ZhHans.MIXLY_GENERAL_KEY = "普通按键";
|
||||
ZhHans.MIXLY_RELEASE = "自动释放";
|
||||
ZhHans.MIXLY_SPECIAL_KEY0 = "无操作(释放)";
|
||||
ZhHans.MIXLY_SPECIAL_KEY1 = "左Control键";
|
||||
ZhHans.MIXLY_SPECIAL_KEY2 = "左Shift键";
|
||||
ZhHans.MIXLY_SPECIAL_KEY4 = "左Alt键";
|
||||
ZhHans.MIXLY_SPECIAL_KEY8 = "左Windows键";
|
||||
ZhHans.MIXLY_SPECIAL_KEY16 = "右Control键";
|
||||
ZhHans.MIXLY_SPECIAL_KEY32 = "右Shift键";
|
||||
ZhHans.MIXLY_SPECIAL_KEY64 = "右Alt键";
|
||||
ZhHans.MIXLY_SPECIAL_KEY128 = "右Windows键";
|
||||
ZhHans.MIXLY_MOUSE_INPUT = "鼠标输入";
|
||||
ZhHans.MIXLY_MOUSE_KEYS = "鼠标按键";
|
||||
ZhHans.MIXLY_X_Y_CHANGES = "x、y轴改变量 ";
|
||||
ZhHans.MIXLY_MOUSE_LEFT_KEY = "左键";
|
||||
ZhHans.MIXLY_MOUSE_RIGHT_KEY = "右键";
|
||||
ZhHans.MIXLY_MOUSE_MID_KEY = "中键";
|
||||
ZhHans.MIXLY_WHEEL_CHANGES = "滚轮改变量";
|
||||
ZhHans.MIXLY_STR_PRINT = "字符输入";
|
||||
ZhHans.MIXLY_STR_PRINT_TIME_DELAY = "每个字符间隔";
|
||||
})();
|
||||
@@ -3639,4 +3639,27 @@ ZhHant.MIXLY_ESP32_CONNECT_URL_TOOLTIP = "發起網絡請求";
|
||||
ZhHant.MIXLY_ESP32_UREQUESTS_URL_TOOLTIP = "通過API的URL發起網絡請求";
|
||||
ZhHant.MIXLY_ESP32_URL_REPONSE = "API返回數據";
|
||||
ZhHant.MIXLY_ESP32_URL_REPONSE_TOOLTIP = "獲得API返回的數據";
|
||||
ZhHant.MIXLY_GET_UNIQUE_IDEN = "獲取主控板的唯一標識";
|
||||
ZhHant.MIXLY_KEYBOARD_INPUT = "鍵盤輸入";
|
||||
ZhHant.MIXLY_SPECIAL_KEY = "特殊按鍵";
|
||||
ZhHant.MIXLY_GENERAL_KEY = "普通按鍵";
|
||||
ZhHant.MIXLY_RELEASE = "自動釋放";
|
||||
ZhHant.MIXLY_SPECIAL_KEY0 = "無操作(釋放)";
|
||||
ZhHant.MIXLY_SPECIAL_KEY1 = "左Control鍵";
|
||||
ZhHant.MIXLY_SPECIAL_KEY2 = "左Shift鍵";
|
||||
ZhHant.MIXLY_SPECIAL_KEY4 = "左Alt鍵";
|
||||
ZhHant.MIXLY_SPECIAL_KEY8 = "左Windows鍵";
|
||||
ZhHant.MIXLY_SPECIAL_KEY16 = "右Control鍵";
|
||||
ZhHant.MIXLY_SPECIAL_KEY32 = "右Shift鍵";
|
||||
ZhHant.MIXLY_SPECIAL_KEY64 = "右Alt鍵";
|
||||
ZhHant.MIXLY_SPECIAL_KEY128 = "右Windows鍵";
|
||||
ZhHant.MIXLY_MOUSE_INPUT = "鼠標輸入";
|
||||
ZhHant.MIXLY_MOUSE_KEYS = "鼠標按鍵";
|
||||
ZhHant.MIXLY_X_Y_CHANGES = "x、y軸改變量 ";
|
||||
ZhHant.MIXLY_MOUSE_LEFT_KEY = "左鍵";
|
||||
ZhHant.MIXLY_MOUSE_RIGHT_KEY = "右鍵";
|
||||
ZhHant.MIXLY_MOUSE_MID_KEY = "中鍵";
|
||||
ZhHant.MIXLY_WHEEL_CHANGES = "滾輪改變量";
|
||||
ZhHant.MIXLY_STR_PRINT = "字符輸入";
|
||||
ZhHant.MIXLY_STR_PRINT_TIME_DELAY = "每個字符間隔";
|
||||
})();
|
||||
Reference in New Issue
Block a user