初始化提交
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
import { Profile } from 'mixly';
|
||||
|
||||
const pins = {};
|
||||
|
||||
pins["MixGo MINI"] = {
|
||||
description: "MicroPython[ESP32C3 MixGo MINI]",
|
||||
digital_pin: Profile.generate(['0-10', '18']),
|
||||
input_pin: Profile.generate(['0-10', '18']),
|
||||
output_pin: Profile.generate(['0-10', '18']),
|
||||
pwm_input: Profile.generate(['0-10', '18'], 'pwm', 'pwm'),
|
||||
analog_input: Profile.generate(['0-4'], 'adc', 'adc'),
|
||||
pwm_output: Profile.generate(['0-10', '18'], 'pwm', 'pwm'),
|
||||
analog_output: Profile.generate(['0-4'], 'adc', 'adc'),
|
||||
espnow_channel: Profile.generate(['1-13']),
|
||||
haskylens_model: Profile.generate(['0-4']),
|
||||
digital: Profile.generate(['0-10', '18'], 'pin', 'pin'),
|
||||
pwm_pin: Profile.generate(['0-10', '18']),
|
||||
pwm: Profile.generate(['0-10', '18'], 'pwm', 'pwm'),
|
||||
analog_pin: Profile.generate(['0-4']),
|
||||
analog: Profile.generate(['0-4'], 'adc', 'adc'),
|
||||
button: [["B1", "B1key"], ["B2", "B2key"], ["A1", "A1key"], ["A2", "A2key"], ["A3", "A3key"], ["A4", "A4key"]],
|
||||
buttonB: [["B1", "B1key"], ["B2", "B2key"]],
|
||||
axis: Profile.generate(['0-4']),
|
||||
exlcdh: Profile.generate(['0-11']),
|
||||
exlcdv: Profile.generate(['0-7']),
|
||||
brightness: Profile.generate(['0-9']),
|
||||
tts_voice: Profile.generate(['0-16']),
|
||||
tts_builtin_music: Profile.generate(['0-47']),
|
||||
tts_bgmusic: Profile.generate(['0-15']),
|
||||
//builtinimg: [["HEART", "matrix.Image.HEART"],["HEART_SMALL", "matrix.Image.HEART_SMALL"],["HAPPY", "matrix.Image.HAPPY"],["SAD", "matrix.Image.SAD"],["SMILE", "matrix.Image.SMILE"],["SILLY", "matrix.Image.SILLY"],["FABULOUS", "matrix.Image.FABULOUS"],["SURPRISED", "matrix.Image.SURPRISED"],["ASLEEP", "matrix.Image.ASLEEP"],["ANGRY", "matrix.Image.ANGRY"],["CONFUSED", "matrix.Image.CONFUSED"],["NO", "matrix.Image.NO"],["YES", "matrix.Image.YES"],["LEFT_ARROW", "matrix.Image.LEFT_ARROW"],["RIGHT_ARROW", "matrix.Image.RIGHT_ARROW"],["DRESS", "matrix.Image.DRESS"],["TRANSFORMERS", "matrix.Image.TRANSFORMERS"],["SCISSORS", "matrix.Image.SCISSORS"],["EXIT", "matrix.Image.EXIT"],["TREE", "matrix.Image.TREE"],["PACMAN", "matrix.Image.PACMAN"],["TARGET", "matrix.Image.TARGET"],["TSHIRT", "matrix.Image.TSHIRT"],["ROLLERSKATE", "matrix.Image.ROLLERSKATE"],["DUCK", "matrix.Image.DUCK"],["HOUSE", "matrix.Image.HOUSE"],["TORTOISE", "matrix.Image.TORTOISE"],["BUTTERFLY", "matrix.Image.BUTTERFLY"],["STICKFIGURE", "matrix.Image.STICKFIGURE"],["GHOST", "matrix.Image.GHOST"],["PITCHFORK", "matrix.Image.PITCHFORK"],["MUSIC_QUAVERS", "matrix.Image.MUSIC_QUAVERS"],["MUSIC_QUAVER", "matrix.Image.MUSIC_QUAVER"],["MUSIC_CROTCHET", "matrix.Image.MUSIC_CROTCHET"],["COW", "matrix.Image.COW"],["RABBIT", "matrix.Image.RABBIT"],["SQUARE_SMALL", "matrix.Image.SQUARE_SMALL"],["SQUARE", "matrix.Image.SQUARE"],["DIAMOND_SMALL", "matrix.Image.DIAMOND_SMALL"],["DIAMOND", "matrix.Image.DIAMOND"],["CHESSBOARD", "matrix.Image.CHESSBOARD"],["TRIANGLE_LEFT", "matrix.Image.TRIANGLE_LEFT"],["TRIANGLE", "matrix.Image.TRIANGLE"],["SNAKE", "matrix.Image.SNAKE"],["UMBRELLA", "matrix.Image.UMBRELLA"],["SKULL", "matrix.Image.SKULL"],["GIRAFFE", "matrix.Image.GIRAFFE"],["SWORD", "matrix.Image.SWORD"]],
|
||||
builtinimg: [["HEART", "onboard_matrix.HEART"], ["HEART_SMALL", "onboard_matrix.HEART_SMALL"], ["HAPPY", "onboard_matrix.HAPPY"], ["SAD", "onboard_matrix.SAD"], ["SMILE", "onboard_matrix.SMILE"], ["ANGRY", "onboard_matrix.ANGRY"], ["NO", "onboard_matrix.NO"], ["YES", "onboard_matrix.YES"]],
|
||||
builtinimg_extern: [["HEART", "matrix32x12.Matrix.HEART"], ["HEART_SMALL", "matrix32x12.Matrix.HEART_SMALL"], ["HAPPY", "matrix32x12.Matrix.HAPPY"], ["SAD", "matrix32x12.Matrix.SAD"], ["SMILE", "matrix32x12.Matrix.SMILE"], ["SILLY", "matrix32x12.Matrix.SILLY"], ["FABULOUS", "matrix32x12.Matrix.FABULOUS"], ["SURPRISED", "matrix32x12.Matrix.SURPRISED"], ["ASLEEP", "matrix32x12.Matrix.ASLEEP"], ["ANGRY", "matrix32x12.Matrix.ANGRY"], ["CONFUSED", "matrix32x12.Matrix.CONFUSED"], ["NO", "matrix32x12.Matrix.NO"], ["YES", "matrix32x12.Matrix.YES"], ["LEFT_ARROW", "matrix32x12.Matrix.LEFT_ARROW"], ["RIGHT_ARROW", "matrix32x12.Matrix.RIGHT_ARROW"], ["DRESS", "matrix32x12.Matrix.DRESS"], ["TRANSFORMERS", "matrix32x12.Matrix.TRANSFORMERS"], ["SCISSORS", "matrix32x12.Matrix.SCISSORS"], ["EXIT", "matrix32x12.Matrix.EXIT"], ["TREE", "matrix32x12.Matrix.TREE"], ["PACMAN", "matrix32x12.Matrix.PACMAN"], ["TARGET", "matrix32x12.Matrix.TARGET"], ["TSHIRT", "matrix32x12.Matrix.TSHIRT"], ["ROLLERSKATE", "matrix32x12.Matrix.ROLLERSKATE"], ["DUCK", "matrix32x12.Matrix.DUCK"], ["HOUSE", "matrix32x12.Matrix.HOUSE"], ["TORTOISE", "matrix32x12.Matrix.TORTOISE"], ["BUTTERFLY", "matrix32x12.Matrix.BUTTERFLY"], ["STICKFIGURE", "matrix32x12.Matrix.STICKFIGURE"], ["GHOST", "matrix32x12.Matrix.GHOST"], ["PITCHFORK", "matrix32x12.Matrix.PITCHFORK"], ["onboard_music_QUAVERS", "matrix32x12.Matrix.onboard_music_QUAVERS"], ["onboard_music_QUAVER", "matrix32x12.Matrix.onboard_music_QUAVER"], ["onboard_music_CROTCHET", "matrix32x12.Matrix.onboard_music_CROTCHET"], ["COW", "matrix32x12.Matrix.COW"], ["RABBIT", "matrix32x12.Matrix.RABBIT"], ["SQUARE_SMALL", "matrix32x12.Matrix.SQUARE_SMALL"], ["SQUARE", "matrix32x12.Matrix.SQUARE"], ["DIAMOND_SMALL", "matrix32x12.Matrix.DIAMOND_SMALL"], ["DIAMOND", "matrix32x12.Matrix.DIAMOND"], ["CHESSBOARD", "matrix32x12.Matrix.CHESSBOARD"], ["TRIANGLE_LEFT", "matrix32x12.Matrix.TRIANGLE_LEFT"], ["TRIANGLE", "matrix32x12.Matrix.TRIANGLE"], ["SNAKE", "matrix32x12.Matrix.SNAKE"], ["UMBRELLA", "matrix32x12.Matrix.UMBRELLA"], ["SKULL", "matrix32x12.Matrix.SKULL"], ["GIRAFFE", "matrix32x12.Matrix.GIRAFFE"], ["SWORD", "matrix32x12.Matrix.SWORD"]],
|
||||
imglist: [["ALL_CLOCKS", "matrix.Image.ALL_CLOCKS"], ["ALL_ARROWS", "matrix.Image.ALL_ARROWS"]],
|
||||
playlist: [["DADADADUM", "onboard_music.DADADADUM"], ["BIRTHDAY", "onboard_music.BIRTHDAY"], ["BA_DING", "onboard_music.BA_DING"], ["JUMP_UP", "onboard_music.JUMP_UP"], ["JUMP_DOWN", "onboard_music.JUMP_DOWN"], ["POWER_UP", "onboard_music.POWER_UP"], ["POWER_DOWN", "onboard_music.POWER_DOWN"]],
|
||||
playlist_extern: [["DADADADUM", "DADADADUM"], ["ENTERTAINER", "ENTERTAINER"], ["PRELUDE", "PRELUDE"], ["ODE", "ODE"], ["NYAN", "NYAN"], ["RINGTONE", "RINGTONE"], ["FUNK", "FUNK"], ["BLUES", "BLUES"], ["BIRTHDAY", "BIRTHDAY"], ["WEDDING", "WEDDING"], ["FUNERAL", "FUNERAL"], ["PUNCHLINE", "PUNCHLINE"], ["PYTHON", "PYTHON"], ["BADDY", "BADDY"], ["CHASE", "CHASE"], ["BA_DING", "BA_DING"], ["WAWAWAWAA", "WAWAWAWAA"], ["JUMP_UP", "JUMP_UP"], ["JUMP_DOWN", "JUMP_DOWN"], ["POWER_UP", "POWER_UP"], ["POWER_DOWN", "POWER_DOWN"]],
|
||||
tone_notes: [
|
||||
["NOTE_C3", "131"], ["NOTE_D3", "147"], ["NOTE_E3", "165"], ["NOTE_F3", "175"], ["NOTE_G3", "196"], ["NOTE_A3", "220"], ["NOTE_B3", "247"],
|
||||
["NOTE_C4", "262"], ["NOTE_D4", "294"], ["NOTE_E4", "330"], ["NOTE_F4", "349"], ["NOTE_G4", "392"], ["NOTE_A4", "440"], ["NOTE_B4", "494"],
|
||||
["NOTE_C5", "523"], ["NOTE_D5", "587"], ["NOTE_E5", "659"], ["NOTE_F5", "698"], ["NOTE_G5", "784"], ["NOTE_A5", "880"], ["NOTE_B5", "988"]
|
||||
],
|
||||
serial_pin: [["pin0", "0"], ["pin1", "1"], ["pin2", "2"], ["pin8", "8"], ["pin12", "12"], ["pin13", "13"], ["pin14", "14"], ["pin15", "15"], ["pin16", "16"]],
|
||||
radio_power: [['0', '0'], ['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7']],
|
||||
radio_datarate: [["1Mbit", "RATE_1MBIT"], ["250Kbit", "RATE_250KBIT"], ["2Mbit", "RATE_2MBIT"]],
|
||||
one_more: [["ONE_SHOT", "ONE_SHOT"], ["PERIODIC", "PERIODIC"]],
|
||||
digital_dot: [["0", "0"], ["1", "1"], ["2", "2"]]
|
||||
};
|
||||
|
||||
pins["ESP32C2 Generic(2M)"] = {
|
||||
description: "MicroPython[ESP32C3 MixGo CC]",
|
||||
digital_pin: Profile.generate(['0-11', '18-21']),
|
||||
input_pin: Profile.generate(['0-11', '18-21']),
|
||||
output_pin: Profile.generate(['0-11', '18-21']),
|
||||
pwm_input: Profile.generate(['0-11', '18-21'], 'pwm', 'pwm'),
|
||||
analog_input: Profile.generate(['0-5'], 'adc', 'adc'),
|
||||
pwm_output: Profile.generate(['0-11', '18-21'], 'pwm', 'pwm'),
|
||||
analog_output: Profile.generate(['0-5'], 'adc', 'adc'),
|
||||
espnow_channel: Profile.generate(['1-13']),
|
||||
haskylens_model: Profile.generate(['0-4']),
|
||||
digital: Profile.generate(['0-11', '18-21'], 'pin', 'pin'),
|
||||
pwm_pin: Profile.generate(['0-11', '18-21']),
|
||||
pwm: Profile.generate(['0-11', '18-21'], 'pwm', 'pwm'),
|
||||
analog_pin: Profile.generate(['0-5']),
|
||||
analog: Profile.generate(['0-5'], 'adc', 'adc'),
|
||||
button: [["B1", "B1key"], ["B2", "B2key"], ["A1", "A1key"], ["A2", "A2key"], ["A3", "A3key"], ["A4", "A4key"]],
|
||||
buttonB: [["B1", "B1key"], ["B2", "B2key"]],
|
||||
axis: Profile.generate(['0-4']),
|
||||
exlcdh: Profile.generate(['0-31']),
|
||||
exlcdv: Profile.generate(['0-11']),
|
||||
brightness: Profile.generate(['0-9']),
|
||||
tts_voice: Profile.generate(['0-16']),
|
||||
tts_builtin_music: Profile.generate(['0-47']),
|
||||
tts_bgmusic: Profile.generate(['0-15']),
|
||||
//builtinimg: [["HEART", "matrix.Image.HEART"],["HEART_SMALL", "matrix.Image.HEART_SMALL"],["HAPPY", "matrix.Image.HAPPY"],["SAD", "matrix.Image.SAD"],["SMILE", "matrix.Image.SMILE"],["SILLY", "matrix.Image.SILLY"],["FABULOUS", "matrix.Image.FABULOUS"],["SURPRISED", "matrix.Image.SURPRISED"],["ASLEEP", "matrix.Image.ASLEEP"],["ANGRY", "matrix.Image.ANGRY"],["CONFUSED", "matrix.Image.CONFUSED"],["NO", "matrix.Image.NO"],["YES", "matrix.Image.YES"],["LEFT_ARROW", "matrix.Image.LEFT_ARROW"],["RIGHT_ARROW", "matrix.Image.RIGHT_ARROW"],["DRESS", "matrix.Image.DRESS"],["TRANSFORMERS", "matrix.Image.TRANSFORMERS"],["SCISSORS", "matrix.Image.SCISSORS"],["EXIT", "matrix.Image.EXIT"],["TREE", "matrix.Image.TREE"],["PACMAN", "matrix.Image.PACMAN"],["TARGET", "matrix.Image.TARGET"],["TSHIRT", "matrix.Image.TSHIRT"],["ROLLERSKATE", "matrix.Image.ROLLERSKATE"],["DUCK", "matrix.Image.DUCK"],["HOUSE", "matrix.Image.HOUSE"],["TORTOISE", "matrix.Image.TORTOISE"],["BUTTERFLY", "matrix.Image.BUTTERFLY"],["STICKFIGURE", "matrix.Image.STICKFIGURE"],["GHOST", "matrix.Image.GHOST"],["PITCHFORK", "matrix.Image.PITCHFORK"],["MUSIC_QUAVERS", "matrix.Image.MUSIC_QUAVERS"],["MUSIC_QUAVER", "matrix.Image.MUSIC_QUAVER"],["MUSIC_CROTCHET", "matrix.Image.MUSIC_CROTCHET"],["COW", "matrix.Image.COW"],["RABBIT", "matrix.Image.RABBIT"],["SQUARE_SMALL", "matrix.Image.SQUARE_SMALL"],["SQUARE", "matrix.Image.SQUARE"],["DIAMOND_SMALL", "matrix.Image.DIAMOND_SMALL"],["DIAMOND", "matrix.Image.DIAMOND"],["CHESSBOARD", "matrix.Image.CHESSBOARD"],["TRIANGLE_LEFT", "matrix.Image.TRIANGLE_LEFT"],["TRIANGLE", "matrix.Image.TRIANGLE"],["SNAKE", "matrix.Image.SNAKE"],["UMBRELLA", "matrix.Image.UMBRELLA"],["SKULL", "matrix.Image.SKULL"],["GIRAFFE", "matrix.Image.GIRAFFE"],["SWORD", "matrix.Image.SWORD"]],
|
||||
builtinimg: [["HEART", "onboard_matrix.HEART"], ["HEART_SMALL", "onboard_matrix.HEART_SMALL"], ["HAPPY", "onboard_matrix.HAPPY"], ["SAD", "onboard_matrix.SAD"], ["SMILE", "onboard_matrix.SMILE"], ["SILLY", "onboard_matrix.SILLY"], ["FABULOUS", "onboard_matrix.FABULOUS"], ["SURPRISED", "onboard_matrix.SURPRISED"], ["ASLEEP", "onboard_matrix.ASLEEP"], ["ANGRY", "onboard_matrix.ANGRY"], ["CONFUSED", "onboard_matrix.CONFUSED"], ["NO", "onboard_matrix.NO"], ["YES", "onboard_matrix.YES"]],
|
||||
builtinimg_extern: [["HEART", "matrix32x12.Matrix.HEART"], ["HEART_SMALL", "matrix32x12.Matrix.HEART_SMALL"], ["HAPPY", "matrix32x12.Matrix.HAPPY"], ["SAD", "matrix32x12.Matrix.SAD"], ["SMILE", "matrix32x12.Matrix.SMILE"], ["SILLY", "matrix32x12.Matrix.SILLY"], ["FABULOUS", "matrix32x12.Matrix.FABULOUS"], ["SURPRISED", "matrix32x12.Matrix.SURPRISED"], ["ASLEEP", "matrix32x12.Matrix.ASLEEP"], ["ANGRY", "matrix32x12.Matrix.ANGRY"], ["CONFUSED", "matrix32x12.Matrix.CONFUSED"], ["NO", "matrix32x12.Matrix.NO"], ["YES", "matrix32x12.Matrix.YES"], ["LEFT_ARROW", "matrix32x12.Matrix.LEFT_ARROW"], ["RIGHT_ARROW", "matrix32x12.Matrix.RIGHT_ARROW"], ["DRESS", "matrix32x12.Matrix.DRESS"], ["TRANSFORMERS", "matrix32x12.Matrix.TRANSFORMERS"], ["SCISSORS", "matrix32x12.Matrix.SCISSORS"], ["EXIT", "matrix32x12.Matrix.EXIT"], ["TREE", "matrix32x12.Matrix.TREE"], ["PACMAN", "matrix32x12.Matrix.PACMAN"], ["TARGET", "matrix32x12.Matrix.TARGET"], ["TSHIRT", "matrix32x12.Matrix.TSHIRT"], ["ROLLERSKATE", "matrix32x12.Matrix.ROLLERSKATE"], ["DUCK", "matrix32x12.Matrix.DUCK"], ["HOUSE", "matrix32x12.Matrix.HOUSE"], ["TORTOISE", "matrix32x12.Matrix.TORTOISE"], ["BUTTERFLY", "matrix32x12.Matrix.BUTTERFLY"], ["STICKFIGURE", "matrix32x12.Matrix.STICKFIGURE"], ["GHOST", "matrix32x12.Matrix.GHOST"], ["PITCHFORK", "matrix32x12.Matrix.PITCHFORK"], ["onboard_music_QUAVERS", "matrix32x12.Matrix.onboard_music_QUAVERS"], ["onboard_music_QUAVER", "matrix32x12.Matrix.onboard_music_QUAVER"], ["onboard_music_CROTCHET", "matrix32x12.Matrix.onboard_music_CROTCHET"], ["COW", "matrix32x12.Matrix.COW"], ["RABBIT", "matrix32x12.Matrix.RABBIT"], ["SQUARE_SMALL", "matrix32x12.Matrix.SQUARE_SMALL"], ["SQUARE", "matrix32x12.Matrix.SQUARE"], ["DIAMOND_SMALL", "matrix32x12.Matrix.DIAMOND_SMALL"], ["DIAMOND", "matrix32x12.Matrix.DIAMOND"], ["CHESSBOARD", "matrix32x12.Matrix.CHESSBOARD"], ["TRIANGLE_LEFT", "matrix32x12.Matrix.TRIANGLE_LEFT"], ["TRIANGLE", "matrix32x12.Matrix.TRIANGLE"], ["SNAKE", "matrix32x12.Matrix.SNAKE"], ["UMBRELLA", "matrix32x12.Matrix.UMBRELLA"], ["SKULL", "matrix32x12.Matrix.SKULL"], ["GIRAFFE", "matrix32x12.Matrix.GIRAFFE"], ["SWORD", "matrix32x12.Matrix.SWORD"]],
|
||||
imglist: [["ALL_CLOCKS", "matrix.Image.ALL_CLOCKS"], ["ALL_ARROWS", "matrix.Image.ALL_ARROWS"]],
|
||||
playlist: [["DADADADUM", "onboard_music.DADADADUM"], ["ENTERTAINER", "onboard_music.ENTERTAINER"], ["PRELUDE", "onboard_music.PRELUDE"], ["ODE", "onboard_music.ODE"], ["NYAN", "onboard_music.NYAN"], ["RINGTONE", "onboard_music.RINGTONE"], ["FUNK", "onboard_music.FUNK"], ["BLUES", "onboard_music.BLUES"], ["BIRTHDAY", "onboard_music.BIRTHDAY"], ["WEDDING", "onboard_music.WEDDING"], ["FUNERAL", "onboard_music.FUNERAL"], ["PUNCHLINE", "onboard_music.PUNCHLINE"], ["PYTHON", "onboard_music.PYTHON"], ["BADDY", "onboard_music.BADDY"], ["CHASE", "onboard_music.CHASE"], ["BA_DING", "onboard_music.BA_DING"], ["WAWAWAWAA", "onboard_music.WAWAWAWAA"], ["JUMP_UP", "onboard_music.JUMP_UP"], ["JUMP_DOWN", "onboard_music.JUMP_DOWN"], ["POWER_UP", "onboard_music.POWER_UP"], ["POWER_DOWN", "onboard_music.POWER_DOWN"]],
|
||||
playlist_extern: [["DADADADUM", "DADADADUM"], ["ENTERTAINER", "ENTERTAINER"], ["PRELUDE", "PRELUDE"], ["ODE", "ODE"], ["NYAN", "NYAN"], ["RINGTONE", "RINGTONE"], ["FUNK", "FUNK"], ["BLUES", "BLUES"], ["BIRTHDAY", "BIRTHDAY"], ["WEDDING", "WEDDING"], ["FUNERAL", "FUNERAL"], ["PUNCHLINE", "PUNCHLINE"], ["PYTHON", "PYTHON"], ["BADDY", "BADDY"], ["CHASE", "CHASE"], ["BA_DING", "BA_DING"], ["WAWAWAWAA", "WAWAWAWAA"], ["JUMP_UP", "JUMP_UP"], ["JUMP_DOWN", "JUMP_DOWN"], ["POWER_UP", "POWER_UP"], ["POWER_DOWN", "POWER_DOWN"]],
|
||||
tone_notes: [
|
||||
["NOTE_C3", "131"], ["NOTE_D3", "147"], ["NOTE_E3", "165"], ["NOTE_F3", "175"], ["NOTE_G3", "196"], ["NOTE_A3", "220"], ["NOTE_B3", "247"],
|
||||
["NOTE_C4", "262"], ["NOTE_D4", "294"], ["NOTE_E4", "330"], ["NOTE_F4", "349"], ["NOTE_G4", "392"], ["NOTE_A4", "440"], ["NOTE_B4", "494"],
|
||||
["NOTE_C5", "523"], ["NOTE_D5", "587"], ["NOTE_E5", "659"], ["NOTE_F5", "698"], ["NOTE_G5", "784"], ["NOTE_A5", "880"], ["NOTE_B5", "988"]
|
||||
],
|
||||
serial_pin: [["pin0", "0"], ["pin1", "1"], ["pin2", "2"], ["pin8", "8"], ["pin12", "12"], ["pin13", "13"], ["pin14", "14"], ["pin15", "15"], ["pin16", "16"]],
|
||||
radio_power: [['0', '0'], ['1', '1'], ['2', '2'], ['3', '3'], ['4', '4'], ['5', '5'], ['6', '6'], ['7', '7']],
|
||||
radio_datarate: [["1Mbit", "RATE_1MBIT"], ["250Kbit", "RATE_250KBIT"], ["2Mbit", "RATE_2MBIT"]],
|
||||
one_more: [["ONE_SHOT", "ONE_SHOT"], ["PERIODIC", "PERIODIC"]],
|
||||
digital_dot: [["0", "0"], ["1", "1"], ["2", "2"]],
|
||||
};
|
||||
|
||||
export default pins;
|
||||
366
boards/default_src/micropython_esp32c2/blocks/inout.js
Normal file
366
boards/default_src/micropython_esp32c2/blocks/inout.js
Normal file
@@ -0,0 +1,366 @@
|
||||
import * as Blockly from 'blockly/core';
|
||||
|
||||
const BASE_HUE = 20; //'#ae3838';//40;
|
||||
|
||||
export const inout_highlow = {
|
||||
init: function () {
|
||||
this.setColour(BASE_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MIXLY_HIGH, "HIGH"],
|
||||
[Blockly.Msg.MIXLY_LOW, "LOW"]
|
||||
]), 'BOOL')
|
||||
this.setOutput(true, Boolean);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_INOUT_HIGHLOW_TOOLTIP);
|
||||
}
|
||||
};
|
||||
|
||||
export const inout_digital_write = {
|
||||
init: function () {
|
||||
this.setColour(BASE_HUE);
|
||||
this.appendValueInput("PIN", Number)
|
||||
.appendField(Blockly.Msg.MIXLY_Digital_PINMODEOUT)
|
||||
.setCheck(Number);
|
||||
this.appendValueInput("STAT")
|
||||
.appendField(Blockly.Msg.MIXLY_STAT)
|
||||
.setCheck([Number, Boolean]);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setInputsInline(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_INOUT_DIGITAL_WRITE_TOOLTIP);
|
||||
}
|
||||
};
|
||||
|
||||
export const inout_digital_read = {
|
||||
init: function () {
|
||||
this.setColour(BASE_HUE);
|
||||
this.appendValueInput("PIN", Number)
|
||||
.appendField(Blockly.Msg.MIXLY_MICROBIT_PY_STORAGE_GET)
|
||||
.appendField(Blockly.Msg.MIXLY_Digital_PINMODEIN)
|
||||
.setCheck(Number);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_ESP32_MACHINE_VALUE)
|
||||
this.setInputsInline(true);
|
||||
this.setOutput(true, [Boolean, Number]);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_INOUT_DIGITAL_READ_TOOLTIP);
|
||||
}
|
||||
};
|
||||
|
||||
export const inout_pwm_analog_write = {
|
||||
init: function () {
|
||||
this.setColour(BASE_HUE);
|
||||
this.appendValueInput("PIN", Number)
|
||||
.appendField("PWM" + Blockly.Msg.MIXLY_Analog_PINMODEOUT)
|
||||
.setCheck(Number);
|
||||
this.appendValueInput("NUM", Number)
|
||||
.appendField(Blockly.Msg.MIXLY_VALUE2)
|
||||
.setCheck(Number);
|
||||
this.setInputsInline(true);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_INOUT_PWM_ANALOG_WRITE_TOOLTIP);
|
||||
}
|
||||
};
|
||||
|
||||
export const inout_analog_write = {
|
||||
init: function () {
|
||||
this.setColour(BASE_HUE);
|
||||
this.appendValueInput("PIN", Number)
|
||||
.appendField("DAC" + Blockly.Msg.MIXLY_Analog_PINMODEOUT)
|
||||
.setCheck(Number);
|
||||
this.appendValueInput("NUM", Number)
|
||||
.appendField(Blockly.Msg.MIXLY_VALUE2)
|
||||
.setCheck(Number);
|
||||
this.setInputsInline(true);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_TOOLTIP);
|
||||
}
|
||||
};
|
||||
|
||||
export const inout_analog_write_set = {
|
||||
init: function () {
|
||||
this.setColour(BASE_HUE);
|
||||
this.appendValueInput("PIN", Number)
|
||||
.appendField(Blockly.Msg.MIXLY_Analog_PINMODEOUT)
|
||||
.setCheck(Number);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_MICROBIT_JS_PERIOD_MIL)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MIXLY_mSecond, "period"],
|
||||
[Blockly.Msg.MIXLY_uSecond, "period_microseconds"]
|
||||
]), "key");
|
||||
this.appendValueInput("NUM", Number)
|
||||
.appendField(Blockly.Msg.MIXLY_STAT)
|
||||
.setCheck(Number);
|
||||
this.setInputsInline(true);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_INOUT_ANALOG_WRITE_SET_TOOLTIP);
|
||||
}
|
||||
};
|
||||
|
||||
export const inout_pwm_analog_write_set_freq = {
|
||||
init: function () {
|
||||
this.setColour(BASE_HUE);
|
||||
this.appendValueInput("PIN", Number)
|
||||
.appendField("PWM" + Blockly.Msg.MIXLY_Analog_PINMODEOUT)
|
||||
.setCheck(Number);
|
||||
this.appendValueInput("NUM", Number)
|
||||
.appendField(Blockly.Msg.MIXLY_FREQUENCY + Blockly.Msg.MIXLY_STAT)
|
||||
.setCheck(Number);
|
||||
this.setInputsInline(true);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_INOUT_PWM_ANALOG_WRITE_SET_FREQ_TOOLTIP);
|
||||
}
|
||||
};
|
||||
|
||||
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 = {
|
||||
init: function () {
|
||||
this.setColour(BASE_HUE);
|
||||
this.appendValueInput("PIN", Number)
|
||||
.appendField(Blockly.Msg.MIXLY_Analog_PINMODEIN)
|
||||
.setCheck(Number);
|
||||
this.appendDummyInput("")
|
||||
.appendField(Blockly.Msg.MIXLY_ESP32_REF_VOLTAGE + Blockly.Msg.MIXLY_STAT)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
["3.3V", "machine.ADC.ATTN_11DB"],
|
||||
["2.2V", "machine.ADC.ATTN_6DB"],
|
||||
["1.5V", "machine.ADC.ATTN_2_5DB"],
|
||||
["1.2V", "machine.ADC.ATTN_0DB"]
|
||||
]), "atten");
|
||||
this.setInputsInline(true);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_INOUT_ANALOG_ATTEN_TOOLTIP);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
export const inout_pin_pressed = {
|
||||
init: function () {
|
||||
this.setColour(BASE_HUE);
|
||||
this.appendValueInput('pin')
|
||||
.appendField(Blockly.Msg.MIXLY_MICROBIT_PY_STORAGE_GET)
|
||||
.appendField(Blockly.Msg.MIXLY_ESP32_TOUCH_SENSOR);
|
||||
// this.appendDummyInput()
|
||||
// .appendField(Blockly.Msg.MIXLY_IS_TOUCHED);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_ESP32_MACHINE_VALUE)
|
||||
this.setOutput(true, Number);
|
||||
this.setInputsInline(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_INOUT_PIN_PRESSED_TOOLTIP);
|
||||
}
|
||||
};
|
||||
|
||||
export const inout_pin_attachInterrupt = {
|
||||
init: function () {
|
||||
this.setColour(20);
|
||||
this.appendValueInput("PIN", Number)
|
||||
.appendField(Blockly.Msg.MIXLY_ATTACHINTERRUPT_PIN)
|
||||
.setCheck(Number);
|
||||
this.appendDummyInput("")
|
||||
.appendField(Blockly.Msg.MIXLY_MODE)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MIXLY_RISING, "machine.Pin.IRQ_RISING"],
|
||||
[Blockly.Msg.MIXLY_FALLING, "machine.Pin.IRQ_FALLING"],
|
||||
[Blockly.Msg.MIXLY_CHANGE, "(machine.Pin.IRQ_RISING | machine.Pin.IRQ_FALLING)"]
|
||||
]), "mode");
|
||||
this.appendValueInput('DO')
|
||||
.appendField(Blockly.Msg.MIXLY_DO)
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_INOUT_PIN_ATTACHINTERRUPT_TOOLTIP);
|
||||
}
|
||||
};
|
||||
|
||||
export const inout_digital_init = {
|
||||
init: function () {
|
||||
this.setColour(20);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_SETUP)
|
||||
.appendField(new Blockly.FieldTextInput('pin#'), 'PIN_OBJ');
|
||||
this.appendDummyInput("")
|
||||
.appendField(Blockly.Msg.MIXLY_MICROPYTHON_AS)
|
||||
// .appendField(Blockly.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE+Blockly.Msg.LISTS_SET_INDEX_INPUT_TO)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MIXLY_Digital_PINMODEOUT, "machine.Pin.OUT"],
|
||||
[Blockly.Msg.MIXLY_Digital_PINMODEIN, "machine.Pin.IN"],
|
||||
[Blockly.Msg.MIXLY_PINMODEPULLUP, "machine.Pin.IN, machine.Pin.PULL_UP"],
|
||||
[Blockly.Msg.MIXLY_PINMODEPULLDOWN, "machine.Pin.IN, machine.Pin.PULL_DOWN"]
|
||||
]), "MODE")
|
||||
this.appendValueInput("PIN", Number)
|
||||
.appendField(Blockly.Msg.MIXLY_PIN)
|
||||
.setCheck(Number);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setInputsInline(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_INOUT_DIGITAL_INIT_TOOLTIP);
|
||||
},
|
||||
getVars: function () {
|
||||
return [this.getFieldValue('PIN_OBJ') == 'pin#' ? 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_pwm_analog_write_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('pwm#'), 'PIN_OBJ')
|
||||
.appendField(Blockly.Msg.MIXLY_MICROPYTHON_AS)
|
||||
this.appendDummyInput("")
|
||||
.appendField("PWM" + Blockly.Msg.MIXLY_Analog_PINMODEOUT)
|
||||
// .appendField('pwm')
|
||||
// .appendField(new Blockly.FieldDropdown(profile.default.pwm_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_PWM_ANALOG_WRITE_INIT_TOOLTIP);
|
||||
},
|
||||
getVars: function () {
|
||||
return [this.getFieldValue('PIN_OBJ') == 'pwm#' ? 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_analog_write_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('dac#'), 'PIN_OBJ')
|
||||
.appendField(Blockly.Msg.MIXLY_MICROPYTHON_AS)
|
||||
this.appendDummyInput("")
|
||||
.appendField("DAC" + Blockly.Msg.MIXLY_Analog_PINMODEOUT)
|
||||
// .appendField('dac')
|
||||
// .appendField(new Blockly.FieldDropdown(profile.default.dac_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_WRITE_INIT_TOOLTIP);
|
||||
},
|
||||
getVars: function () {
|
||||
return [this.getFieldValue('PIN_OBJ') == 'dac#' ? 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_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 = {
|
||||
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('tc#'), 'PIN_OBJ')
|
||||
.appendField(Blockly.Msg.MIXLY_MICROPYTHON_AS)
|
||||
this.appendDummyInput("")
|
||||
.appendField(Blockly.Msg.MIXLY_ESP32_TOUCH_SENSOR)
|
||||
// .appendField('tc')
|
||||
// .appendField(new Blockly.FieldDropdown(profile.default.tc_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_PIN_PRESSED_INIT_TOOLTIP);
|
||||
},
|
||||
getVars: function () {
|
||||
return [this.getFieldValue('PIN_OBJ') == 'tc#' ? 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_pinMode = inout_digital_init;
|
||||
export const inout_analog_write_set_freq = inout_pwm_analog_write_set_freq;
|
||||
export const pin_pressed_init = inout_pin_pressed_init;
|
||||
export const pin_pressed = inout_pin_pressed;
|
||||
export const controls_pin_attachInterrupt = inout_pin_attachInterrupt;
|
||||
149
boards/default_src/micropython_esp32c2/blocks/me_g1.js
Normal file
149
boards/default_src/micropython_esp32c2/blocks/me_g1.js
Normal file
@@ -0,0 +1,149 @@
|
||||
import * as Blockly from 'blockly/core';
|
||||
import { Boards } from 'mixly';
|
||||
|
||||
const MEG1_HUE = 40;
|
||||
|
||||
export const me_g1_aht11 = {
|
||||
init: function () {
|
||||
var version = Boards.getSelectedBoardKey().split(':')[2]
|
||||
if (version == "mixgo_me") { var name = 'ME G1' }
|
||||
this.setColour(MEG1_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(name)
|
||||
.appendField(Blockly.Msg.MIXLY_TEM_HUM + " AHT21")
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MIXLY_GETTEMPERATUE, "temperature"],
|
||||
[Blockly.Msg.MIXLY_GETHUMIDITY, "humidity"]
|
||||
]), "key");
|
||||
this.setOutput(true, Number);
|
||||
this.setInputsInline(true);
|
||||
var thisBlock = this;
|
||||
this.setTooltip(function () {
|
||||
var mode = thisBlock.getFieldValue('key');
|
||||
var TOOLTIPS = {
|
||||
"temperature": Blockly.Msg.MIXLY_MICROBIT_SENSOR_SHT_temperature_TOOLTIP,
|
||||
"relative_humidity": Blockly.Msg.MIXLY_MICROBIT_SENSOR_SHT_HUM_TOOLTIP
|
||||
};
|
||||
return TOOLTIPS[mode]
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export const me_g1_hp203 = {
|
||||
init: function () {
|
||||
var version = Boards.getSelectedBoardKey().split(':')[2]
|
||||
if (version == "mixgo_me") { var name = 'ME G1' }
|
||||
this.setColour(MEG1_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(name)
|
||||
.appendField(Blockly.Msg.MIXLY_Altitude + Blockly.Msg.MSG.catSensor + " HP203X")
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MIXLY_GETPRESSURE, "pressure()"],
|
||||
[Blockly.Msg.MIXLY_GETTEMPERATUE, "temperature()"],
|
||||
[Blockly.Msg.MIXLY_GET_ALTITUDE, "altitude()"],
|
||||
]), "key");
|
||||
this.setOutput(true, Number);
|
||||
this.setInputsInline(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const me_g1_varistor = {
|
||||
init: function () {
|
||||
var version = Boards.getSelectedBoardKey().split(':')[2]
|
||||
if (version == "mixgo_me") { var name = 'ME G1' }
|
||||
this.setColour(MEG1_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField(name)
|
||||
.appendField(Blockly.Msg.MIXLY_MIXGO_NOVA_POTENTIAL_NUM);
|
||||
this.setOutput(true, Number);
|
||||
this.setInputsInline(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const me_g1_rfid_readid = {
|
||||
init: function () {
|
||||
var version = Boards.getSelectedBoardKey().split(':')[2]
|
||||
if (version == "mixgo_me") { var name = 'ME G1' }
|
||||
this.setColour(MEG1_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField(name)
|
||||
.appendField("RFID" + Blockly.Msg.MIXLY_RFID_READ_CARD);
|
||||
this.appendDummyInput("")
|
||||
.appendField(Blockly.Msg.MIXLY_RFID_READ_CARD_UID);
|
||||
this.setOutput(true, Number);
|
||||
this.setInputsInline(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const me_g1_rfid_readcontent = {
|
||||
init: function () {
|
||||
var version = Boards.getSelectedBoardKey().split(':')[2]
|
||||
if (version == "mixgo_me") { var name = 'ME G1' }
|
||||
this.setColour(MEG1_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField(name)
|
||||
.appendField("RFID" + Blockly.Msg.MIXLY_RFID_READ_CARD);
|
||||
this.appendValueInput('SECTOR')
|
||||
.appendField(Blockly.Msg.MIXLY_LIST_INDEX)
|
||||
this.appendDummyInput("")
|
||||
.appendField(Blockly.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL);
|
||||
this.setOutput(true, Number);
|
||||
this.setInputsInline(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const me_g1_rfid_write = {
|
||||
init: function () {
|
||||
var version = Boards.getSelectedBoardKey().split(':')[2]
|
||||
if (version == "mixgo_me") { var name = 'ME G1' }
|
||||
this.setColour(MEG1_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField(name)
|
||||
.appendField(Blockly.Msg.MIXLY_COMMUNICATION_RFID_WRITE);
|
||||
this.appendValueInput('SECTOR')
|
||||
.appendField(Blockly.Msg.MIXLY_LIST_INDEX)
|
||||
this.appendValueInput('CONTENT')
|
||||
.appendField(Blockly.Msg.MIXLY_COMMUNICATION_WRITE_NUM)
|
||||
this.setInputsInline(true);
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
}
|
||||
};
|
||||
|
||||
export const me_g1_rfid_write_outcome = {
|
||||
init: function () {
|
||||
var version = Boards.getSelectedBoardKey().split(':')[2]
|
||||
if (version == "mixgo_me") { var name = 'ME G1' }
|
||||
this.setColour(MEG1_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField(name)
|
||||
.appendField(Blockly.Msg.MIXLY_COMMUNICATION_RFID_WRITE);
|
||||
this.appendValueInput('SECTOR')
|
||||
.appendField(Blockly.Msg.MIXLY_LIST_INDEX)
|
||||
this.appendValueInput('CONTENT')
|
||||
.appendField(Blockly.Msg.MIXLY_COMMUNICATION_WRITE_NUM)
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.RETURN_SUCCESS_OR_NOT)
|
||||
this.setInputsInline(true);
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const me_g1_rfid_status = {
|
||||
init: function () {
|
||||
var version = Boards.getSelectedBoardKey().split(':')[2]
|
||||
if (version == "mixgo_me") { var name = 'ME G1' }
|
||||
this.setColour(MEG1_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField(name)
|
||||
.appendField("RFID");
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MIXLY_RFID_SCAN_OK, "0"],
|
||||
[Blockly.Msg.MIXLY_RFID_SCAN_NOTAGERR, "1"],
|
||||
[Blockly.Msg.MIXLY_RFID_SCAN_ERROR, "2"]
|
||||
]), "key");
|
||||
this.setOutput(true, Number);
|
||||
this.setInputsInline(true);
|
||||
}
|
||||
};
|
||||
316
boards/default_src/micropython_esp32c2/blocks/me_go.js
Normal file
316
boards/default_src/micropython_esp32c2/blocks/me_go.js
Normal file
@@ -0,0 +1,316 @@
|
||||
import * as Blockly from 'blockly/core';
|
||||
|
||||
const MEGO_HUE = 100;
|
||||
|
||||
// LED
|
||||
export const me_go_light_number = {
|
||||
init: function () {
|
||||
this.setColour(MEGO_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MIXGO_LEFT_FRONT + Blockly.Msg.COLOUR_RGB_GREEN + Blockly.Msg.MIXLY_EXTERN_LED, "GLED[0]"],
|
||||
[Blockly.Msg.MIXGO_RIGHT_FRONT + Blockly.Msg.COLOUR_RGB_GREEN + Blockly.Msg.MIXLY_EXTERN_LED, "GLED[1]"],
|
||||
[Blockly.Msg.MIXGO_LEFT_BACK + Blockly.Msg.COLOUR_RGB_GREEN + Blockly.Msg.MIXLY_EXTERN_LED, "GLED[3]"],
|
||||
[Blockly.Msg.MIXGO_RIGHT_BACK + Blockly.Msg.COLOUR_RGB_GREEN + Blockly.Msg.MIXLY_EXTERN_LED, "GLED[2]"],
|
||||
[Blockly.Msg.MIXGO_LEFT_FRONT + Blockly.Msg.COLOUR_RGB_RED + Blockly.Msg.MIXLY_EXTERN_LED, "RLED[0]"],
|
||||
[Blockly.Msg.MIXGO_RIGHT_FRONT + Blockly.Msg.COLOUR_RGB_RED + Blockly.Msg.MIXLY_EXTERN_LED, "RLED[1]"],
|
||||
[Blockly.Msg.MIXGO_LEFT_BACK + Blockly.Msg.COLOUR_RGB_RED + Blockly.Msg.MIXLY_EXTERN_LED, "RLED[3]"],
|
||||
[Blockly.Msg.MIXGO_RIGHT_BACK + Blockly.Msg.COLOUR_RGB_RED + Blockly.Msg.MIXLY_EXTERN_LED, "RLED[2]"],
|
||||
[Blockly.Msg.ME_GO_LIGHT_HEADLIGHT, "WLED"]
|
||||
]), 'op')
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const me_go_led_bright = {
|
||||
init: function () {
|
||||
this.setColour(MEGO_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_SETTING);
|
||||
this.appendValueInput('led')
|
||||
.appendField('ME GO')
|
||||
this.appendValueInput('bright')
|
||||
.appendField(Blockly.Msg.MIXLY_PULSEIN_STAT)
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setInputsInline(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_LED_SETONOFF);
|
||||
}
|
||||
};
|
||||
|
||||
export const me_go_get_led_bright = {
|
||||
init: function () {
|
||||
this.setColour(MEGO_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_MICROBIT_PY_STORAGE_GET);
|
||||
this.appendValueInput('led')
|
||||
.appendField('ME GO')
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_BRIGHTNESS)
|
||||
this.setOutput(true);
|
||||
this.setInputsInline(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_LED_GETONOFF);
|
||||
}
|
||||
};
|
||||
|
||||
export const me_go_get_led_state = {
|
||||
init: function () {
|
||||
this.setColour(MEGO_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_MICROBIT_PY_STORAGE_GET);
|
||||
this.appendValueInput('led')
|
||||
.appendField('ME GO')
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_PULSEIN_STAT)
|
||||
this.setOutput(true);
|
||||
this.setInputsInline(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_ESP32_LED_GETONOFF);
|
||||
}
|
||||
};
|
||||
|
||||
export const me_go_led_brightness = {
|
||||
init: function () {
|
||||
this.setColour(MEGO_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_SETTING);
|
||||
this.appendValueInput('led')
|
||||
.appendField('ME GO')
|
||||
this.appendValueInput('bright')
|
||||
.appendField(Blockly.Msg.MIXLY_BRIGHTNESS)
|
||||
this.appendDummyInput("")
|
||||
.appendField("%")
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setInputsInline(true);
|
||||
this.setTooltip(Blockly.Msg.MIXLY_SETTING + Blockly.Msg.MIXLY_BUILDIN_LED + Blockly.Msg.MIXLY_BRIGHTNESS + '(0-10)');
|
||||
}
|
||||
};
|
||||
|
||||
export const me_go_stepper_keep = {
|
||||
init: function () {
|
||||
this.setColour(MEGO_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField("ME GO")
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.blockpy_forward, "F"],
|
||||
[Blockly.Msg.blockpy_backward, "B"],
|
||||
[Blockly.Msg.blockpy_left, "L"],
|
||||
[Blockly.Msg.blockpy_right, "R"]
|
||||
]), "VAR");
|
||||
this.appendValueInput('speed')
|
||||
.setCheck(Number)
|
||||
.setAlign(Blockly.inputs.Align.RIGHT)
|
||||
.appendField(Blockly.Msg.MIXLY_STEPPER_SET_SPEED);
|
||||
this.appendDummyInput("")
|
||||
.appendField("%")
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setInputsInline(true);
|
||||
}
|
||||
}
|
||||
|
||||
export const me_go_stepper_stop = {
|
||||
init: function () {
|
||||
this.setColour(MEGO_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField("ME GO")
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MOTOR_P, "P"],
|
||||
[Blockly.Msg.MOTOR_N, "N"]
|
||||
]), "VAR");
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setInputsInline(true);
|
||||
}
|
||||
}
|
||||
|
||||
export const me_go_dc_motor = {
|
||||
init: function () {
|
||||
this.setColour(MEGO_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField("ME GO")
|
||||
.appendField(Blockly.Msg.MOTOR_DC)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MIXLYCAR_WHEEL_LEFT, "0"],
|
||||
[Blockly.Msg.MIXLYCAR_WHEEL_RIGHT, "1"],
|
||||
[Blockly.Msg.ME_GO_MOTOR_EXTERN, "2"]
|
||||
]), "wheel");
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_MICROBIT_Direction)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.ROTATION_FORWARD, "CW"],
|
||||
[Blockly.Msg.ROTATION_BACKWARD, "CCW"],
|
||||
[Blockly.Msg.MOTOR_P, "P"],
|
||||
[Blockly.Msg.MOTOR_N, "N"]
|
||||
]), "direction");
|
||||
this.appendValueInput('speed')
|
||||
.setCheck(Number)
|
||||
.setAlign(Blockly.inputs.Align.RIGHT)
|
||||
.appendField(Blockly.Msg.MIXLY_STEPPER_SET_SPEED);
|
||||
this.appendDummyInput("")
|
||||
.appendField("%")
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setInputsInline(true);
|
||||
}
|
||||
}
|
||||
|
||||
export const me_go_hall_attachInterrupt = {
|
||||
init: function () {
|
||||
this.setColour(MEGO_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(Blockly.Msg.MIXLY_ESP32_INTERRUPT)
|
||||
.appendField(Blockly.Msg.ME_GO_HALL_SENSOR)
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.TEXT_TRIM_LEFT, "A"], [Blockly.Msg.TEXT_TRIM_RIGHT, "B"]]), "mode");
|
||||
this.appendValueInput('DO')
|
||||
.appendField(Blockly.Msg.MIXLY_DO)
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setInputsInline(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const me_go_hall_initialize = {
|
||||
init: function () {
|
||||
this.setColour(MEGO_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(Blockly.Msg.ME_GO_HALL_SENSOR)
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.TEXT_TRIM_LEFT, "A"], [Blockly.Msg.TEXT_TRIM_RIGHT, "B"]]), "mode");
|
||||
this.appendDummyInput("")
|
||||
.appendField(Blockly.Msg.MIXLY_SETUP)
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown([['turns', "turns"], ['distance', "distance"], ['turns,distance', 'all']]), "args");
|
||||
this.appendValueInput('num')
|
||||
.setCheck(Number)
|
||||
this.setPreviousStatement(true);
|
||||
this.setNextStatement(true);
|
||||
this.setInputsInline(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const me_go_hall_data = {
|
||||
init: function () {
|
||||
this.setColour(MEGO_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(Blockly.Msg.ME_GO_HALL_SENSOR)
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.TEXT_TRIM_LEFT, "A"], [Blockly.Msg.TEXT_TRIM_RIGHT, "B"]]), "mode");
|
||||
this.appendDummyInput("")
|
||||
.appendField(Blockly.Msg.MIXLY_MICROBIT_PY_STORAGE_GET)
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown([['turns', "turns"], ['distance', "distance"], ['speed', 'speed']]), "args");
|
||||
this.setOutput(true);
|
||||
this.setInputsInline(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const me_go_pin_near_line = {
|
||||
init: function () {
|
||||
this.setColour(MEGO_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_MICROBIT_PY_STORAGE_GET)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.TEXT_TRIM_LEFT, "[0]"],
|
||||
[Blockly.Msg.MIXGO_LEFT_MID, "[1]"],
|
||||
[Blockly.Msg.MIXGO_RIGHT_MID, "[2]"],
|
||||
[Blockly.Msg.TEXT_TRIM_RIGHT, "[3]"],
|
||||
[Blockly.Msg.MIXLY_ALL, ""]
|
||||
]), "key")
|
||||
.appendField(Blockly.Msg.MIXGO_LINE_SENSOR_VAL);
|
||||
this.setOutput(true, Number);
|
||||
this.setInputsInline(true);
|
||||
this.setTooltip(function () {
|
||||
var mode0 = Blockly.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP;
|
||||
var mode1 = Blockly.Msg.MIXLY_ESP32_NEAR;
|
||||
return mode0 + mode1
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export const me_go_pin_near = {
|
||||
init: function () {
|
||||
this.setColour(MEGO_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_MICROBIT_PY_STORAGE_GET)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MIXGO_LEFT_FRONT, "[0]"],
|
||||
[Blockly.Msg.MIXGO_RIGHT_FRONT, "[1]"],
|
||||
[Blockly.Msg.MIXGO_LEFT_BACK, "[3]"],
|
||||
[Blockly.Msg.MIXGO_RIGHT_BACK, "[2]"],
|
||||
[Blockly.Msg.MIXLY_ALL, ""]
|
||||
]), "key")
|
||||
.appendField(Blockly.Msg.MIXGO_PROXIMITY_SENSOR);
|
||||
this.setOutput(true, Number);
|
||||
this.setInputsInline(true);
|
||||
this.setTooltip(function () {
|
||||
var mode0 = Blockly.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP;
|
||||
var mode1 = Blockly.Msg.MIXLY_ESP32_NEAR;
|
||||
return mode0 + mode1
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export const me_go_pin_near_state_change = {
|
||||
init: function () {
|
||||
this.setColour(MEGO_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_MIXGO_CAR_SENSOR_ONBOARD_CHANGE)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.MIXLY_ME_GO_CAR_SENSOR_ONBOARD_AUTO_CHANGE, "AS"],
|
||||
[Blockly.Msg.MIXLY_MIXGO_CAR_USE_LINE_ONLY, "LP"],
|
||||
[Blockly.Msg.MIXLY_MIXGO_CAR_USE_PROXIMITY_ONLY, "OA"],
|
||||
[Blockly.Msg.MIXLY_ME_GO_CAR_LIGHT_SEEKING_ONLY, "LS"],
|
||||
[Blockly.Msg.ME_GO_SENSOR_MODE_OFF, "CL"]
|
||||
]), "key");
|
||||
this.setPreviousStatement(true, null);
|
||||
this.setNextStatement(true, null);
|
||||
this.setInputsInline(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const sensor_mixgome_eulerangles = {
|
||||
init: function () {
|
||||
this.setColour(MEGO_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(Blockly.Msg.MIXLY_GET_GESTURE)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.ME_GO_PITCH, '[0]'],
|
||||
[Blockly.Msg.ME_GO_ROLL, '[1]'],
|
||||
[Blockly.Msg.ME_GO_PITCH + ', ' + Blockly.Msg.ME_GO_ROLL, '']
|
||||
]), 'angle');
|
||||
// this.appendDummyInput("")
|
||||
// .appendField(Blockly.Msg.BOARD_DIRECTION)
|
||||
// .appendField(new Blockly.FieldDropdown([
|
||||
// [Blockly.Msg.OLED_VER,'True'],
|
||||
// [Blockly.Msg.OLED_HOR,'False'],
|
||||
// ]),'dir');
|
||||
this.appendDummyInput("")
|
||||
this.setOutput(true, Number);
|
||||
this.setInputsInline(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const me_go_pin_light = {
|
||||
init: function () {
|
||||
this.setColour(MEGO_HUE);
|
||||
this.appendDummyInput()
|
||||
.appendField(Blockly.Msg.MIXLY_MICROBIT_PY_STORAGE_GET)
|
||||
.appendField(new Blockly.FieldDropdown([
|
||||
[Blockly.Msg.TEXT_TRIM_LEFT, "[0]"],
|
||||
[Blockly.Msg.MIXGO_LEFT_MID, "[1]"],
|
||||
[Blockly.Msg.MIXGO_RIGHT_MID, "[2]"],
|
||||
[Blockly.Msg.TEXT_TRIM_RIGHT, "[3]"],
|
||||
[Blockly.Msg.MIXLY_ALL, ""]
|
||||
]), "key")
|
||||
.appendField(Blockly.Msg.MIXLY_ME_GO_CAR_LIGHT_SEEKING_SENSOR);
|
||||
this.setOutput(true, Number);
|
||||
this.setInputsInline(true);
|
||||
this.setTooltip(function () {
|
||||
var mode0 = Blockly.Msg.MIXLY_ESP32_SENSOR_MIXGO_PIN_NEAR_TOOLTIP;
|
||||
var mode1 = Blockly.Msg.MIXLY_ME_GO_CAR_LIGHT_SEEKING_SENSOR;
|
||||
return mode0 + mode1
|
||||
});
|
||||
}
|
||||
};
|
||||
401
boards/default_src/micropython_esp32c2/blocks/pins.js
Normal file
401
boards/default_src/micropython_esp32c2/blocks/pins.js
Normal file
@@ -0,0 +1,401 @@
|
||||
import * as Blockly from 'blockly/core';
|
||||
import { Profile } from 'mixly';
|
||||
|
||||
const PINS_HUE = 230;
|
||||
|
||||
export const pins_digital = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.digital), 'PIN');
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_digital_pin = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.digital_pin), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_input_pin = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.input_pin), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_output_pin = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.output_pin), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const espnow_channel = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.espnow_channel), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const haskylens_model = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.haskylens_model), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const pwm_input = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.pwm_input), 'PIN');
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const analog_input = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.analog_input), 'PIN');
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const pwm_output = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.pwm_output), 'PIN');
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const analog_output = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.analog_output), 'PIN');
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const i2c_A_pin = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.i2c_A_pin), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const i2c_B_pin = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.i2c_B_pin), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
export const spi_A_pin = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.spi_A_pin), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const spi_B_pin = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.spi_B_pin), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const spi_C_pin = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.spi_C_pin), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const spi_D_pin = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.spi_D_pin), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_analog = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.analog), 'PIN');
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_analog_pin = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.analog_pin), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_dac = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.dac), 'PIN');
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_dac_pin = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.dac_pin), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_button = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.button), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_buttonB = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.buttonB), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_pwm = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.pwm), 'PIN');
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_pwm_pin = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.pwm_pin), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_touch_pin = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.touch_pin), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_touch = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.touch), 'PIN');
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_serial = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.serial_pin), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_builtinimg = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.builtinimg), 'PIN');
|
||||
this.setOutput(true, "esp32_image");
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_builtinimg_extern = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.builtinimg_extern), 'PIN');
|
||||
this.setOutput(true, "esp32_image");
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_imglist = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.imglist), 'PIN');
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_playlist = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.playlist), 'PIN');
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_playlist_extern = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.playlist_extern), 'PIN');
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_exlcdh = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.exlcdh), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_exlcdv = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.exlcdv), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_axis = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.axis), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_brightness = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.brightness), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_tts_voice = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.tts_voice), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_tts_builtin_music = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.tts_builtin_music), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_tts_bgmusic = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.tts_bgmusic), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_tone_notes = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.tone_notes), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_radio_power = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.radio_power), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_radio_datarate = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.radio_datarate), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_one_more = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.one_more), 'PIN');
|
||||
this.setOutput(true);
|
||||
}
|
||||
};
|
||||
|
||||
export const pins_digital_dot = {
|
||||
init: function () {
|
||||
this.setColour(PINS_HUE);
|
||||
this.appendDummyInput("")
|
||||
.appendField(new Blockly.FieldDropdown(Profile.default.digital_dot), 'PIN');
|
||||
this.setOutput(true, Number);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user