Update: 更新micropython_esp32c2
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -3,7 +3,7 @@ import { Boards } from 'mixly';
|
|||||||
|
|
||||||
const MEG1_HUE = 40;
|
const MEG1_HUE = 40;
|
||||||
|
|
||||||
export const me_g1_aht11 = {
|
export const mini_g2_aht11 = {
|
||||||
init: function () {
|
init: function () {
|
||||||
var version = Boards.getSelectedBoardKey().split(':')[2]
|
var version = Boards.getSelectedBoardKey().split(':')[2]
|
||||||
if (version == "mixgo_me") { var name = 'ME G1' }
|
if (version == "mixgo_me") { var name = 'ME G1' }
|
||||||
@@ -29,7 +29,7 @@ export const me_g1_aht11 = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const me_g1_hp203 = {
|
export const mini_g2_hp203 = {
|
||||||
init: function () {
|
init: function () {
|
||||||
var version = Boards.getSelectedBoardKey().split(':')[2]
|
var version = Boards.getSelectedBoardKey().split(':')[2]
|
||||||
if (version == "mixgo_me") { var name = 'ME G1' }
|
if (version == "mixgo_me") { var name = 'ME G1' }
|
||||||
@@ -47,7 +47,7 @@ export const me_g1_hp203 = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const me_g1_varistor = {
|
export const mini_g2_varistor = {
|
||||||
init: function () {
|
init: function () {
|
||||||
var version = Boards.getSelectedBoardKey().split(':')[2]
|
var version = Boards.getSelectedBoardKey().split(':')[2]
|
||||||
if (version == "mixgo_me") { var name = 'ME G1' }
|
if (version == "mixgo_me") { var name = 'ME G1' }
|
||||||
@@ -60,7 +60,7 @@ export const me_g1_varistor = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const me_g1_rfid_readid = {
|
export const mini_g2_rfid_readid = {
|
||||||
init: function () {
|
init: function () {
|
||||||
var version = Boards.getSelectedBoardKey().split(':')[2]
|
var version = Boards.getSelectedBoardKey().split(':')[2]
|
||||||
if (version == "mixgo_me") { var name = 'ME G1' }
|
if (version == "mixgo_me") { var name = 'ME G1' }
|
||||||
@@ -75,7 +75,7 @@ export const me_g1_rfid_readid = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const me_g1_rfid_readcontent = {
|
export const mini_g2_rfid_readcontent = {
|
||||||
init: function () {
|
init: function () {
|
||||||
var version = Boards.getSelectedBoardKey().split(':')[2]
|
var version = Boards.getSelectedBoardKey().split(':')[2]
|
||||||
if (version == "mixgo_me") { var name = 'ME G1' }
|
if (version == "mixgo_me") { var name = 'ME G1' }
|
||||||
@@ -92,7 +92,7 @@ export const me_g1_rfid_readcontent = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const me_g1_rfid_write = {
|
export const mini_g2_rfid_write = {
|
||||||
init: function () {
|
init: function () {
|
||||||
var version = Boards.getSelectedBoardKey().split(':')[2]
|
var version = Boards.getSelectedBoardKey().split(':')[2]
|
||||||
if (version == "mixgo_me") { var name = 'ME G1' }
|
if (version == "mixgo_me") { var name = 'ME G1' }
|
||||||
@@ -110,7 +110,7 @@ export const me_g1_rfid_write = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const me_g1_rfid_write_outcome = {
|
export const mini_g2_rfid_write_outcome = {
|
||||||
init: function () {
|
init: function () {
|
||||||
var version = Boards.getSelectedBoardKey().split(':')[2]
|
var version = Boards.getSelectedBoardKey().split(':')[2]
|
||||||
if (version == "mixgo_me") { var name = 'ME G1' }
|
if (version == "mixgo_me") { var name = 'ME G1' }
|
||||||
@@ -129,7 +129,7 @@ export const me_g1_rfid_write_outcome = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const me_g1_rfid_status = {
|
export const mini_g2_rfid_status = {
|
||||||
init: function () {
|
init: function () {
|
||||||
var version = Boards.getSelectedBoardKey().split(':')[2]
|
var version = Boards.getSelectedBoardKey().split(':')[2]
|
||||||
if (version == "mixgo_me") { var name = 'ME G1' }
|
if (version == "mixgo_me") { var name = 'ME G1' }
|
||||||
@@ -1,21 +1,21 @@
|
|||||||
import MicropythonESP32C2Pins from './blocks/esp32_profile';
|
import MicropythonESP32C2Pins from './blocks/esp32_profile';
|
||||||
import * as MicropythonESP32C2InoutBlocks from './blocks/inout';
|
import * as MicropythonESP32C2InoutBlocks from './blocks/inout';
|
||||||
import * as MicropythonESP32C2MEG1Blocks from './blocks/me_g1';
|
import * as MicropythonESP32C2MiniG2Blocks from './blocks/mini_g2';
|
||||||
import * as MicropythonESP32C2MEGOBlocks from './blocks/me_go';
|
import * as MicropythonESP32C2MEGOBlocks from './blocks/me_go';
|
||||||
import * as MicropythonESP32C2PinsBlocks from './blocks/pins';
|
import * as MicropythonESP32C2PinsBlocks from './blocks/pins';
|
||||||
import * as MicropythonESP32C2InoutGenerators from './generators/inout';
|
import * as MicropythonESP32C2InoutGenerators from './generators/inout';
|
||||||
import * as MicropythonESP32C2MEG1Generators from './generators/me_g1';
|
import * as MicropythonESP32C2MiniG2Generators from './generators/mini_g2';
|
||||||
import * as MicropythonESP32C2MEGOGenerators from './generators/me_go';
|
import * as MicropythonESP32C2MEGOGenerators from './generators/me_go';
|
||||||
import * as MicropythonESP32C2PinsGenerators from './generators/pins';
|
import * as MicropythonESP32C2PinsGenerators from './generators/pins';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
MicropythonESP32C2Pins,
|
MicropythonESP32C2Pins,
|
||||||
MicropythonESP32C2InoutBlocks,
|
MicropythonESP32C2InoutBlocks,
|
||||||
MicropythonESP32C2MEG1Blocks,
|
MicropythonESP32C2MiniG2Blocks,
|
||||||
MicropythonESP32C2MEGOBlocks,
|
MicropythonESP32C2MEGOBlocks,
|
||||||
MicropythonESP32C2PinsBlocks,
|
MicropythonESP32C2PinsBlocks,
|
||||||
MicropythonESP32C2InoutGenerators,
|
MicropythonESP32C2InoutGenerators,
|
||||||
MicropythonESP32C2MEG1Generators,
|
MicropythonESP32C2MiniG2Generators,
|
||||||
MicropythonESP32C2MEGOGenerators,
|
MicropythonESP32C2MEGOGenerators,
|
||||||
MicropythonESP32C2PinsGenerators
|
MicropythonESP32C2PinsGenerators
|
||||||
};
|
};
|
||||||
88
boards/default_src/micropython_esp32c2/generators/mini_g2.js
Normal file
88
boards/default_src/micropython_esp32c2/generators/mini_g2.js
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
import { Boards } from 'mixly';
|
||||||
|
|
||||||
|
export const mini_g2_aht11 = function (_, generator) {
|
||||||
|
var key = this.getFieldValue('key');
|
||||||
|
generator.definitions_['import_mini_g2'] = 'import mini_g2';
|
||||||
|
var code = 'mini_g2.ext_ahtx0.' + key + '()';
|
||||||
|
return [code, generator.ORDER_ATOMIC];
|
||||||
|
}
|
||||||
|
|
||||||
|
export const mini_g2_hp203 = function (_, generator) {
|
||||||
|
var key = this.getFieldValue('key');
|
||||||
|
generator.definitions_['import_mini_g2'] = 'import mini_g2';
|
||||||
|
var code = 'mini_g2.ext_hp203x.' + key;
|
||||||
|
return [code, generator.ORDER_ATOMIC];
|
||||||
|
}
|
||||||
|
|
||||||
|
export const mini_g2_varistor = function (_, generator) {
|
||||||
|
generator.definitions_['import_mini_g2'] = 'import mini_g2';
|
||||||
|
var code = 'mini_g2.varistor()';
|
||||||
|
return [code, generator.ORDER_ATOMIC];
|
||||||
|
}
|
||||||
|
|
||||||
|
export const mini_g2_rfid_readid = function (_, generator) {
|
||||||
|
generator.definitions_['import_mini_g2'] = 'import mini_g2';
|
||||||
|
var version = Boards.getSelectedBoardKey().split(':')[2];
|
||||||
|
if (version == "mixgo_mini") {
|
||||||
|
generator.definitions_['import_mini_g2_ext_rfid'] = 'from mini_g2 import ext_rfid';
|
||||||
|
var code = 'ext_rfid.read_card(0, x="id")';
|
||||||
|
} else {
|
||||||
|
generator.definitions_['import_mini_g2'] = 'import mini_g2';
|
||||||
|
var code = 'mini_g2.ext_rc522.read_card(0, x="id")';
|
||||||
|
}
|
||||||
|
return [code, generator.ORDER_ATOMIC];
|
||||||
|
}
|
||||||
|
|
||||||
|
export const mini_g2_rfid_readcontent = function (_, generator) {
|
||||||
|
var version = Boards.getSelectedBoardKey().split(':')[2];
|
||||||
|
var sector = generator.valueToCode(this, 'SECTOR', generator.ORDER_ATOMIC);
|
||||||
|
if (version == "mixgo_mini") {
|
||||||
|
generator.definitions_['import_mini_g2_ext_rfid'] = 'from mini_g2 import ext_rfid';
|
||||||
|
var code = 'ext_rfid.read_card(' + sector + ')';
|
||||||
|
} else {
|
||||||
|
generator.definitions_['import_mini_g2'] = 'import mini_g2';
|
||||||
|
var code = 'mini_g2.ext_rc522.read_card(' + sector + ')';
|
||||||
|
}
|
||||||
|
return [code, generator.ORDER_ATOMIC];
|
||||||
|
}
|
||||||
|
|
||||||
|
export const mini_g2_rfid_write = function (_, generator) {
|
||||||
|
var version = Boards.getSelectedBoardKey().split(':')[2];
|
||||||
|
var sector = generator.valueToCode(this, 'SECTOR', generator.ORDER_ATOMIC);
|
||||||
|
var cnt = generator.valueToCode(this, 'CONTENT', generator.ORDER_ATOMIC);
|
||||||
|
if (version == "mixgo_mini") {
|
||||||
|
generator.definitions_['import_mini_g2_ext_rfid'] = 'from mini_g2 import ext_rfid';
|
||||||
|
var code = 'ext_rfid.write_card(' + cnt + ',' + sector + ')\n';
|
||||||
|
} else {
|
||||||
|
generator.definitions_['import_mini_g2'] = 'import mini_g2';
|
||||||
|
var code = 'mini_g2.ext_rc522.write_card(' + cnt + ',' + sector + ')\n';
|
||||||
|
}
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const mini_g2_rfid_write_outcome = function (_, generator) {
|
||||||
|
var version = Boards.getSelectedBoardKey().split(':')[2];
|
||||||
|
var sector = generator.valueToCode(this, 'SECTOR', generator.ORDER_ATOMIC);
|
||||||
|
var cnt = generator.valueToCode(this, 'CONTENT', generator.ORDER_ATOMIC);
|
||||||
|
if (version == "mixgo_mini") {
|
||||||
|
generator.definitions_['import_mini_g2_ext_rfid'] = 'from mini_g2 import ext_rfid';
|
||||||
|
var code = 'ext_rfid.write_card(' + cnt + ',' + sector + ')';
|
||||||
|
} else {
|
||||||
|
generator.definitions_['import_mini_g2'] = 'import mini_g2';
|
||||||
|
var code = 'mini_g2.ext_rc522.write_card(' + cnt + ',' + sector + ')';
|
||||||
|
}
|
||||||
|
return [code, generator.ORDER_ATOMIC];
|
||||||
|
}
|
||||||
|
|
||||||
|
export const mini_g2_rfid_status = function (_, generator) {
|
||||||
|
var version = Boards.getSelectedBoardKey().split(':')[2];
|
||||||
|
var key = this.getFieldValue('key');
|
||||||
|
if (version == "mixgo_mini") {
|
||||||
|
generator.definitions_['import_mini_g2_ext_rfid'] = 'from mini_g2 import ext_rfid';
|
||||||
|
var code = 'ext_rfid.scan_card()==' + key;
|
||||||
|
} else {
|
||||||
|
generator.definitions_['import_mini_g2'] = 'import mini_g2';
|
||||||
|
var code = 'mini_g2.ext_rc522.scan_card()==' + key;
|
||||||
|
}
|
||||||
|
return [code, generator.ORDER_ATOMIC];
|
||||||
|
}
|
||||||
@@ -77,11 +77,11 @@ import {
|
|||||||
import {
|
import {
|
||||||
MicropythonESP32C2Pins,
|
MicropythonESP32C2Pins,
|
||||||
MicropythonESP32C2InoutBlocks,
|
MicropythonESP32C2InoutBlocks,
|
||||||
MicropythonESP32C2MEG1Blocks,
|
MicropythonESP32C2MiniG2Blocks,
|
||||||
MicropythonESP32C2MEGOBlocks,
|
MicropythonESP32C2MEGOBlocks,
|
||||||
MicropythonESP32C2PinsBlocks,
|
MicropythonESP32C2PinsBlocks,
|
||||||
MicropythonESP32C2InoutGenerators,
|
MicropythonESP32C2InoutGenerators,
|
||||||
MicropythonESP32C2MEG1Generators,
|
MicropythonESP32C2MiniG2Generators,
|
||||||
MicropythonESP32C2MEGOGenerators,
|
MicropythonESP32C2MEGOGenerators,
|
||||||
MicropythonESP32C2PinsGenerators
|
MicropythonESP32C2PinsGenerators
|
||||||
} from './';
|
} from './';
|
||||||
@@ -132,7 +132,7 @@ Object.assign(
|
|||||||
MicroPythonCCG1Blocks,
|
MicroPythonCCG1Blocks,
|
||||||
MicroPythonCEGOBlocks,
|
MicroPythonCEGOBlocks,
|
||||||
MicropythonESP32C2InoutBlocks,
|
MicropythonESP32C2InoutBlocks,
|
||||||
MicropythonESP32C2MEG1Blocks,
|
MicropythonESP32C2MiniG2Blocks,
|
||||||
MicropythonESP32C2MEGOBlocks,
|
MicropythonESP32C2MEGOBlocks,
|
||||||
MicropythonESP32C2PinsBlocks
|
MicropythonESP32C2PinsBlocks
|
||||||
);
|
);
|
||||||
@@ -172,7 +172,7 @@ Object.assign(
|
|||||||
MicroPythonCCG1Generators,
|
MicroPythonCCG1Generators,
|
||||||
MicroPythonCEGOGenerators,
|
MicroPythonCEGOGenerators,
|
||||||
MicropythonESP32C2InoutGenerators,
|
MicropythonESP32C2InoutGenerators,
|
||||||
MicropythonESP32C2MEG1Generators,
|
MicropythonESP32C2MiniG2Generators,
|
||||||
MicropythonESP32C2MEGOGenerators,
|
MicropythonESP32C2MEGOGenerators,
|
||||||
MicropythonESP32C2PinsGenerators
|
MicropythonESP32C2PinsGenerators
|
||||||
);
|
);
|
||||||
@@ -1913,44 +1913,6 @@
|
|||||||
<block type="ce_go_pin_light"></block>
|
<block type="ce_go_pin_light"></block>
|
||||||
<block type="sensor_mixgome_eulerangles" m-show='micropython:esp32c3:mixgo_me'></block>
|
<block type="sensor_mixgome_eulerangles" m-show='micropython:esp32c3:mixgo_me'></block>
|
||||||
</category>
|
</category>
|
||||||
<category id="catME_G1" colour="40" m-show='micropython:esp32c3:mixgo_me'>
|
|
||||||
<block type="me_g1_aht11"></block>
|
|
||||||
<block type="me_g1_hp203"></block>
|
|
||||||
<block type="me_g1_varistor"></block>
|
|
||||||
<block type="me_g1_rfid_readcontent">
|
|
||||||
<value name="SECTOR">
|
|
||||||
<shadow type="math_number">
|
|
||||||
<field name="NUM">0</field>
|
|
||||||
</shadow>
|
|
||||||
</value>
|
|
||||||
</block>
|
|
||||||
<block type="me_g1_rfid_readid"></block>
|
|
||||||
<block type="me_g1_rfid_write">
|
|
||||||
<value name="SECTOR">
|
|
||||||
<shadow type="math_number">
|
|
||||||
<field name="NUM">0</field>
|
|
||||||
</shadow>
|
|
||||||
</value>
|
|
||||||
<value name="CONTENT">
|
|
||||||
<shadow type="text">
|
|
||||||
<field name="TEXT">Mixly</field>
|
|
||||||
</shadow>
|
|
||||||
</value>
|
|
||||||
</block>
|
|
||||||
<block type="me_g1_rfid_write_outcome">
|
|
||||||
<value name="SECTOR">
|
|
||||||
<shadow type="math_number">
|
|
||||||
<field name="NUM">0</field>
|
|
||||||
</shadow>
|
|
||||||
</value>
|
|
||||||
<value name="CONTENT">
|
|
||||||
<shadow type="text">
|
|
||||||
<field name="TEXT">Mixly</field>
|
|
||||||
</shadow>
|
|
||||||
</value>
|
|
||||||
</block>
|
|
||||||
<block type="me_g1_rfid_status"></block>
|
|
||||||
</category>
|
|
||||||
<category id="catCC_G1" colour="40" m-show="micropython:esp32c2:mixgo_mini">
|
<category id="catCC_G1" colour="40" m-show="micropython:esp32c2:mixgo_mini">
|
||||||
<block type="cc_g1_read_bat"></block>
|
<block type="cc_g1_read_bat"></block>
|
||||||
<block type="cc_g1_read_joystick"></block>
|
<block type="cc_g1_read_joystick"></block>
|
||||||
@@ -1958,15 +1920,15 @@
|
|||||||
<block type="cc_g1_turnoff"></block>
|
<block type="cc_g1_turnoff"></block>
|
||||||
</category>
|
</category>
|
||||||
<category id="catMINI_G2" colour="40" m-show='micropython:esp32c2:mixgo_mini'>
|
<category id="catMINI_G2" colour="40" m-show='micropython:esp32c2:mixgo_mini'>
|
||||||
<block type="me_g1_rfid_readcontent">
|
<block type="mini_g2_rfid_readcontent">
|
||||||
<value name="SECTOR">
|
<value name="SECTOR">
|
||||||
<shadow type="math_number">
|
<shadow type="math_number">
|
||||||
<field name="NUM">0</field>
|
<field name="NUM">0</field>
|
||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
</block>
|
</block>
|
||||||
<block type="me_g1_rfid_readid"></block>
|
<block type="mini_g2_rfid_readid"></block>
|
||||||
<block type="me_g1_rfid_write">
|
<block type="mini_g2_rfid_write">
|
||||||
<value name="SECTOR">
|
<value name="SECTOR">
|
||||||
<shadow type="math_number">
|
<shadow type="math_number">
|
||||||
<field name="NUM">0</field>
|
<field name="NUM">0</field>
|
||||||
@@ -1978,7 +1940,7 @@
|
|||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
</block>
|
</block>
|
||||||
<block type="me_g1_rfid_write_outcome">
|
<block type="mini_g2_rfid_write_outcome">
|
||||||
<value name="SECTOR">
|
<value name="SECTOR">
|
||||||
<shadow type="math_number">
|
<shadow type="math_number">
|
||||||
<field name="NUM">0</field>
|
<field name="NUM">0</field>
|
||||||
@@ -1990,7 +1952,7 @@
|
|||||||
</shadow>
|
</shadow>
|
||||||
</value>
|
</value>
|
||||||
</block>
|
</block>
|
||||||
<block type="me_g1_rfid_status"></block>
|
<block type="mini_g2_rfid_status"></block>
|
||||||
</category>
|
</category>
|
||||||
<category id="catIot" colour="#2FAD7A">
|
<category id="catIot" colour="#2FAD7A">
|
||||||
<category id="catBlynk" colour="#2FAD7A">
|
<category id="catBlynk" colour="#2FAD7A">
|
||||||
|
|||||||
Reference in New Issue
Block a user