diff --git a/extensions/apds9960/index.js b/extensions/apds9960/index.js index c5ce8450..ce61cf4a 100644 --- a/extensions/apds9960/index.js +++ b/extensions/apds9960/index.js @@ -3,7 +3,7 @@ const apds9960 = formatMessage => ({ extensionId: 'apds9960', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266'], + 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/apds9960.png`, description: formatMessage({ diff --git a/extensions/chineseTTS/index.js b/extensions/chineseTTS/index.js index 7c7c4a06..65ed3c6e 100644 --- a/extensions/chineseTTS/index.js +++ b/extensions/chineseTTS/index.js @@ -6,7 +6,7 @@ const chineseTTS = formatMessage => ({ extensionId: 'chineseTTS', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266'], + 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/chineseTTS.png`, description: formatMessage({ diff --git a/extensions/cooperativeScheduler/index.js b/extensions/cooperativeScheduler/index.js index 6c4fa8b6..a4acfccc 100644 --- a/extensions/cooperativeScheduler/index.js +++ b/extensions/cooperativeScheduler/index.js @@ -5,7 +5,7 @@ const cooperativeScheduler = formatMessage => ({ }), extensionId: 'cooperativeScheduler', version: '1.0.0', - supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', 'arduinoMega2560'], + supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', 'arduinoMega2560', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/cooperativeScheduler.png`, description: formatMessage({ diff --git a/extensions/dht/index.js b/extensions/dht/index.js index 872c8bef..517bd74b 100644 --- a/extensions/dht/index.js +++ b/extensions/dht/index.js @@ -6,7 +6,7 @@ const dht = formatMessage => ({ extensionId: 'dht', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266'], + 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/dht.png`, description: formatMessage({ diff --git a/extensions/ds18b20/index.js b/extensions/ds18b20/index.js index 3a3d727f..d2c1f34b 100644 --- a/extensions/ds18b20/index.js +++ b/extensions/ds18b20/index.js @@ -6,7 +6,7 @@ const ds18b20 = formatMessage => ({ extensionId: 'ds18b20', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266'], + 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/ds18b20.png`, description: formatMessage({ diff --git a/extensions/eightDigitDisplay/index.js b/extensions/eightDigitDisplay/index.js index 16eead8e..7595ab88 100644 --- a/extensions/eightDigitDisplay/index.js +++ b/extensions/eightDigitDisplay/index.js @@ -6,7 +6,7 @@ const eightDigitDisplay = formatMessage => ({ extensionId: 'eightDigitDisplay', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp8266', 'arduinoEsp32'], + 'arduinoMega2560', 'arduinoEsp8266', 'arduinoEsp32', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/eightDigitDisplay.png`, description: formatMessage({ diff --git a/extensions/eitghtTimesEightMatirxDisplay/index.js b/extensions/eitghtTimesEightMatirxDisplay/index.js index 0ef42600..438f43b2 100644 --- a/extensions/eitghtTimesEightMatirxDisplay/index.js +++ b/extensions/eitghtTimesEightMatirxDisplay/index.js @@ -6,7 +6,7 @@ const eitghtTimesEightMatirxDisplay = formatMessage => ({ extensionId: 'eitghtTimesEightMatirxDisplay', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp8266', 'arduinoEsp32'], + 'arduinoMega2560', 'arduinoEsp8266', 'arduinoEsp32', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/eitghtTimesEightMatirxDisplay.png`, description: formatMessage({ diff --git a/extensions/fourDigitClockDisplay/index.js b/extensions/fourDigitClockDisplay/index.js index d074b950..c72a0df4 100644 --- a/extensions/fourDigitClockDisplay/index.js +++ b/extensions/fourDigitClockDisplay/index.js @@ -6,7 +6,7 @@ const fourDigitClockDisplay = formatMessage => ({ extensionId: 'fourDigitClockDisplay', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp8266', 'arduinoEsp32'], + 'arduinoMega2560', 'arduinoEsp8266', 'arduinoEsp32', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/fourDigitClockDisplay.png`, description: formatMessage({ diff --git a/extensions/insertSourceCode/index.js b/extensions/insertSourceCode/index.js index bfbb3c5d..771998c3 100644 --- a/extensions/insertSourceCode/index.js +++ b/extensions/insertSourceCode/index.js @@ -6,7 +6,7 @@ const insertSourceCode = formatMessage => ({ extensionId: 'insertSourceCode', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266'], + 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/insertSourceCode.png`, description: formatMessage({ diff --git a/extensions/irRemoteReceiver/index.js b/extensions/irRemoteReceiver/index.js index d8e834df..745f72b3 100644 --- a/extensions/irRemoteReceiver/index.js +++ b/extensions/irRemoteReceiver/index.js @@ -6,7 +6,7 @@ const irRemoteReceiver = formatMessage => ({ extensionId: 'irRemoteReceiver', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266'], + 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/irRemoteReceiver.png`, description: formatMessage({ diff --git a/extensions/l298n/index.js b/extensions/l298n/index.js index f1e31f3c..6a3c4341 100644 --- a/extensions/l298n/index.js +++ b/extensions/l298n/index.js @@ -3,7 +3,7 @@ const l298n = formatMessage => ({ extensionId: 'l298n', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp8266'], + 'arduinoMega2560', 'arduinoEsp8266', 'lgt8f328pNano'], author: 'Liang', iconURL: `assets/l298n.png`, description: formatMessage({ diff --git a/extensions/lcd/index.js b/extensions/lcd/index.js index 85964b4b..01ea021a 100644 --- a/extensions/lcd/index.js +++ b/extensions/lcd/index.js @@ -6,7 +6,7 @@ const lcd = formatMessage => ({ extensionId: 'lcd', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp8266', 'arduinoEsp32'], + 'arduinoMega2560', 'arduinoEsp8266', 'arduinoEsp32', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/lcd.png`, description: formatMessage({ diff --git a/extensions/lcd_keypad_shield/assets/lcd_keypad_shield.png b/extensions/lcd_keypad_shield/assets/lcd_keypad_shield.png new file mode 100644 index 00000000..ae0e0e47 Binary files /dev/null and b/extensions/lcd_keypad_shield/assets/lcd_keypad_shield.png differ diff --git a/extensions/lcd_keypad_shield/blocks.js b/extensions/lcd_keypad_shield/blocks.js new file mode 100644 index 00000000..80ea5e71 --- /dev/null +++ b/extensions/lcd_keypad_shield/blocks.js @@ -0,0 +1,175 @@ +/* eslint-disable func-style */ +/* eslint-disable max-len */ +/* eslint-disable require-jsdoc */ +function registerBlocks (Blockly) { + const colour = '#BBBB00'; + const secondaryColour = '#888800'; + + Blockly.Blocks.lcd_init = { + init: function () { + this.jsonInit({ + message0: Blockly.Msg.LCD_INIT, + colour: colour, + secondaryColour: secondaryColour, + extensions: ['shape_statement'] + }); + } + }; + + Blockly.Blocks.lcd_setCursorPosition = { + init: function () { + this.jsonInit({ + message0: Blockly.Msg.LCD_SETCURSORPOSITION, + args0: [ + { + type: 'input_value', + name: 'X' + }, + { + type: 'input_value', + name: 'Y' + } + ], + colour: colour, + secondaryColour: secondaryColour, + extensions: ['shape_statement'] + }); + } + }; + + Blockly.Blocks.lcd_print = { + init: function () { + this.jsonInit({ + message0: Blockly.Msg.LCD_PRINT, + args0: [ + { + type: 'input_value', + name: 'DATA' + } + ], + colour: colour, + secondaryColour: secondaryColour, + extensions: ['shape_statement'] + }); + } + }; + + Blockly.Blocks.lcd_clear = { + init: function () { + this.jsonInit({ + message0: Blockly.Msg.LCD_CLEAR, + colour: colour, + secondaryColour: secondaryColour, + extensions: ['shape_statement'] + }); + } + }; + + Blockly.Blocks.lcd_setBackLight = { + init: function () { + this.jsonInit({ + message0: Blockly.Msg.LCD_SETBACKLIGHT, + args0: [ + { + type: 'field_dropdown', + name: 'STATE', + options: [ + [Blockly.Msg.LCD_SATE_ON, 'on'], + [Blockly.Msg.LCD_SATE_OFF, 'off'] + ] + } + ], + colour: colour, + secondaryColour: secondaryColour, + extensions: ['shape_statement'] + }); + } + }; + + Blockly.Blocks.lcd_setCursorStyle = { + init: function () { + this.jsonInit({ + message0: Blockly.Msg.LCD_SETCURSORSTYLE, + args0: [ + { + type: 'field_dropdown', + name: 'STATE', + options: [ + [Blockly.Msg.LCD_SATE_DISPLAY, 'display'], + [Blockly.Msg.LCD_SATE_HIDE, 'hide'] + ] + }, + { + type: 'field_dropdown', + name: 'STYLE', + options: [ + [Blockly.Msg.LCD_STYLE_BLINK, 'blink'], + [Blockly.Msg.LCD_STYLE_NOBLINK, 'onBlink'] + ] + } + ], + colour: colour, + secondaryColour: secondaryColour, + extensions: ['shape_statement'] + }); + } + }; + + Blockly.Blocks.lcd_left = { + init: function () { + this.jsonInit({ + message0: Blockly.Msg.LCD_LEFT, + colour: colour, + secondaryColour: secondaryColour, + extensions: ['output_boolean'] + }); + } + }; + + Blockly.Blocks.lcd_right = { + init: function () { + this.jsonInit({ + message0: Blockly.Msg.LCD_RIGHT, + colour: colour, + secondaryColour: secondaryColour, + extensions: ['output_boolean'] + }); + } + }; + + Blockly.Blocks.lcd_select = { + init: function () { + this.jsonInit({ + message0: Blockly.Msg.LCD_SELECT, + colour: colour, + secondaryColour: secondaryColour, + extensions: ['output_boolean'] + }); + } + }; + + Blockly.Blocks.lcd_up = { + init: function () { + this.jsonInit({ + message0: Blockly.Msg.LCD_UP, + colour: colour, + secondaryColour: secondaryColour, + extensions: ['output_boolean'] + }); + } + }; + + Blockly.Blocks.lcd_down = { + init: function () { + this.jsonInit({ + message0: Blockly.Msg.LCD_DOWN, + colour: colour, + secondaryColour: secondaryColour, + extensions: ['output_boolean'] + }); + } + }; + return Blockly; +} + +exports = registerBlocks; diff --git a/extensions/lcd_keypad_shield/generator.js b/extensions/lcd_keypad_shield/generator.js new file mode 100644 index 00000000..f526efe5 --- /dev/null +++ b/extensions/lcd_keypad_shield/generator.js @@ -0,0 +1,80 @@ +/* eslint-disable func-style */ +/* eslint-disable max-len */ +/* eslint-disable require-jsdoc */ +function registerGenerators (Blockly) { + Blockly.Arduino.lcd_init = function () { + Blockly.Arduino.includes_.lcd_init = `#include \n#include +#define __lcdks_pressed(x,y)({int value = analogRead(A0);value>x && value < y;})`; + Blockly.Arduino.definitions_.lcd_init = `LiquidCrystal lcd( 8, 9, 4, 5, 6, 7);`; + + return `lcd.begin(16, 2);\n`; + }; + + Blockly.Arduino.lcd_setCursorPosition = function (block) { + const x = Blockly.Arduino.valueToCode(block, 'X', Blockly.Arduino.ORDER_ATOMIC); + const y = Blockly.Arduino.valueToCode(block, 'Y', Blockly.Arduino.ORDER_ATOMIC); + + return `lcd.setCursor(${x}, ${y});\n`; + }; + + Blockly.Arduino.lcd_print = function (block) { + const data = Blockly.Arduino.valueToCode(block, 'DATA', Blockly.Arduino.ORDER_ATOMIC); + + return `lcd.print(${data});\n`; + }; + + Blockly.Arduino.lcd_clear = function () { + return `lcd.clear();\n`; + }; + + Blockly.Arduino.lcd_setBackLight = function (block) { + const state = block.getFieldValue('STATE'); + + if (state === 'on') { + return `lcd.backlight();\n`; + } + return `lcd.noBacklight();\n`; + }; + + Blockly.Arduino.lcd_setCursorStyle = function (block) { + const state = block.getFieldValue('STATE'); + const style = block.getFieldValue('STYLE'); + + let code = ''; + + if (state === 'display') { + code += `lcd.cursor();\n`; + } else { + code += `lcd.noCursor();\n`; + } + + if (style === 'blink') { + code += `lcd.blink();\n`; + } else { + code += `lcd.noBlink();\n`; + } + + return code; + }; + + Blockly.Arduino.lcd_right = function (block) { + return [`__lcdks_pressed(0,60)`, Blockly.Arduino.ORDER_ATOMIC]; + }; + Blockly.Arduino.lcd_up = function (block) { + return [`__lcdks_pressed(60,200)`, Blockly.Arduino.ORDER_ATOMIC]; + }; + Blockly.Arduino.lcd_down = function (block) { + return [`__lcdks_pressed(200,400)`, Blockly.Arduino.ORDER_ATOMIC]; + }; + Blockly.Arduino.lcd_left = function (block) { + return [`__lcdks_pressed(400,600)`, Blockly.Arduino.ORDER_ATOMIC]; + }; + Blockly.Arduino.lcd_select = function (block) { + return [`__lcdks_pressed(600,800)`, Blockly.Arduino.ORDER_ATOMIC]; + }; + + + return Blockly; +} + +exports = registerGenerators; diff --git a/extensions/lcd_keypad_shield/index.js b/extensions/lcd_keypad_shield/index.js new file mode 100644 index 00000000..abac711e --- /dev/null +++ b/extensions/lcd_keypad_shield/index.js @@ -0,0 +1,27 @@ +const lcd = formatMessage => ({ + name: formatMessage({ + id: 'lcdks.name', + default: 'LCD Keypad Shield' + }), + extensionId: 'lcdks', + version: '1.0.0', + supportDevice: ['arduinoUno', 'arduinoLeonardo', + 'arduinoMega2560'], + author: 'Kautism', + iconURL: `assets/lcd_keypad_shield.png`, + description: formatMessage({ + id: 'lcdks.description', + default: '1602 liquid crystal display with keypad contains 5 keys.' + }), + featured: true, + blocks: 'blocks.js', + generator: 'generator.js', + toolbox: 'toolbox.js', + translations: 'translations.js', + library: 'lib', + official: true, + tags: ['display'], + helpLink: 'https://wiki.dfrobot.com/LCD_KeyPad_Shield_For_Arduino_SKU__DFR0009' +}); + +module.exports = lcd; diff --git a/extensions/lcd_keypad_shield/lib/Arduino-LiquidCrystal-library/LiquidCrystal.cpp b/extensions/lcd_keypad_shield/lib/Arduino-LiquidCrystal-library/LiquidCrystal.cpp new file mode 100644 index 00000000..1e1a957f --- /dev/null +++ b/extensions/lcd_keypad_shield/lib/Arduino-LiquidCrystal-library/LiquidCrystal.cpp @@ -0,0 +1,326 @@ +#include "LiquidCrystal.h" + +#include +#include +#include +#include "Arduino.h" + +// When the display powers up, it is configured as follows: +// +// 1. Display clear +// 2. Function set: +// DL = 1; 8-bit interface data +// N = 0; 1-line display +// F = 0; 5x8 dot character font +// 3. Display on/off control: +// D = 0; Display off +// C = 0; Cursor off +// B = 0; Blinking off +// 4. Entry mode set: +// I/D = 1; Increment by 1 +// S = 0; No shift +// +// Note, however, that resetting the Arduino doesn't reset the LCD, so we +// can't assume that it's in that state when a sketch starts (and the +// LiquidCrystal constructor is called). + +LiquidCrystal::LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable, + uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, + uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7) +{ + init(0, rs, rw, enable, d0, d1, d2, d3, d4, d5, d6, d7); +} + +LiquidCrystal::LiquidCrystal(uint8_t rs, uint8_t enable, + uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, + uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7) +{ + init(0, rs, 255, enable, d0, d1, d2, d3, d4, d5, d6, d7); +} + +LiquidCrystal::LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable, + uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3) +{ + init(1, rs, rw, enable, d0, d1, d2, d3, 0, 0, 0, 0); +} + +LiquidCrystal::LiquidCrystal(uint8_t rs, uint8_t enable, + uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3) +{ + init(1, rs, 255, enable, d0, d1, d2, d3, 0, 0, 0, 0); +} + +void LiquidCrystal::init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t enable, + uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, + uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7) +{ + _rs_pin = rs; + _rw_pin = rw; + _enable_pin = enable; + + _data_pins[0] = d0; + _data_pins[1] = d1; + _data_pins[2] = d2; + _data_pins[3] = d3; + _data_pins[4] = d4; + _data_pins[5] = d5; + _data_pins[6] = d6; + _data_pins[7] = d7; + + if (fourbitmode) + _displayfunction = LCD_4BITMODE | LCD_1LINE | LCD_5x8DOTS; + else + _displayfunction = LCD_8BITMODE | LCD_1LINE | LCD_5x8DOTS; + + begin(16, 1); +} + +void LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) { + if (lines > 1) { + _displayfunction |= LCD_2LINE; + } + _numlines = lines; + + setRowOffsets(0x00, 0x40, 0x00 + cols, 0x40 + cols); + + // for some 1 line displays you can select a 10 pixel high font + if ((dotsize != LCD_5x8DOTS) && (lines == 1)) { + _displayfunction |= LCD_5x10DOTS; + } + + pinMode(_rs_pin, OUTPUT); + // we can save 1 pin by not using RW. Indicate by passing 255 instead of pin# + if (_rw_pin != 255) { + pinMode(_rw_pin, OUTPUT); + } + pinMode(_enable_pin, OUTPUT); + + // Do these once, instead of every time a character is drawn for speed reasons. + for (int i=0; i<((_displayfunction & LCD_8BITMODE) ? 8 : 4); ++i) + { + pinMode(_data_pins[i], OUTPUT); + } + + // SEE PAGE 45/46 FOR INITIALIZATION SPECIFICATION! + // according to datasheet, we need at least 40 ms after power rises above 2.7 V + // before sending commands. Arduino can turn on way before 4.5 V so we'll wait 50 + delayMicroseconds(50000); + // Now we pull both RS and R/W low to begin commands + digitalWrite(_rs_pin, LOW); + digitalWrite(_enable_pin, LOW); + if (_rw_pin != 255) { + digitalWrite(_rw_pin, LOW); + } + + //put the LCD into 4 bit or 8 bit mode + if (! (_displayfunction & LCD_8BITMODE)) { + // this is according to the Hitachi HD44780 datasheet + // figure 24, pg 46 + + // we start in 8bit mode, try to set 4 bit mode + write4bits(0x03); + delayMicroseconds(4500); // wait min 4.1ms + + // second try + write4bits(0x03); + delayMicroseconds(4500); // wait min 4.1ms + + // third go! + write4bits(0x03); + delayMicroseconds(150); + + // finally, set to 4-bit interface + write4bits(0x02); + } else { + // this is according to the Hitachi HD44780 datasheet + // page 45 figure 23 + + // Send function set command sequence + command(LCD_FUNCTIONSET | _displayfunction); + delayMicroseconds(4500); // wait more than 4.1 ms + + // second try + command(LCD_FUNCTIONSET | _displayfunction); + delayMicroseconds(150); + + // third go + command(LCD_FUNCTIONSET | _displayfunction); + } + + // finally, set # lines, font size, etc. + command(LCD_FUNCTIONSET | _displayfunction); + + // turn the display on with no cursor or blinking default + _displaycontrol = LCD_DISPLAYON | LCD_CURSOROFF | LCD_BLINKOFF; + display(); + + // clear it off + clear(); + + // Initialize to default text direction (for romance languages) + _displaymode = LCD_ENTRYLEFT | LCD_ENTRYSHIFTDECREMENT; + // set the entry mode + command(LCD_ENTRYMODESET | _displaymode); + +} + +void LiquidCrystal::setRowOffsets(int row0, int row1, int row2, int row3) +{ + _row_offsets[0] = row0; + _row_offsets[1] = row1; + _row_offsets[2] = row2; + _row_offsets[3] = row3; +} + +/********** high level commands, for the user! */ +void LiquidCrystal::clear() +{ + command(LCD_CLEARDISPLAY); // clear display, set cursor position to zero + delayMicroseconds(2000); // this command takes a long time! +} + +void LiquidCrystal::home() +{ + command(LCD_RETURNHOME); // set cursor position to zero + delayMicroseconds(2000); // this command takes a long time! +} + +void LiquidCrystal::setCursor(uint8_t col, uint8_t row) +{ + const size_t max_lines = sizeof(_row_offsets) / sizeof(*_row_offsets); + if ( row >= max_lines ) { + row = max_lines - 1; // we count rows starting w/ 0 + } + if ( row >= _numlines ) { + row = _numlines - 1; // we count rows starting w/ 0 + } + + command(LCD_SETDDRAMADDR | (col + _row_offsets[row])); +} + +// Turn the display on/off (quickly) +void LiquidCrystal::noDisplay() { + _displaycontrol &= ~LCD_DISPLAYON; + command(LCD_DISPLAYCONTROL | _displaycontrol); +} +void LiquidCrystal::display() { + _displaycontrol |= LCD_DISPLAYON; + command(LCD_DISPLAYCONTROL | _displaycontrol); +} + +// Turns the underline cursor on/off +void LiquidCrystal::noCursor() { + _displaycontrol &= ~LCD_CURSORON; + command(LCD_DISPLAYCONTROL | _displaycontrol); +} +void LiquidCrystal::cursor() { + _displaycontrol |= LCD_CURSORON; + command(LCD_DISPLAYCONTROL | _displaycontrol); +} + +// Turn on and off the blinking cursor +void LiquidCrystal::noBlink() { + _displaycontrol &= ~LCD_BLINKON; + command(LCD_DISPLAYCONTROL | _displaycontrol); +} +void LiquidCrystal::blink() { + _displaycontrol |= LCD_BLINKON; + command(LCD_DISPLAYCONTROL | _displaycontrol); +} + +// These commands scroll the display without changing the RAM +void LiquidCrystal::scrollDisplayLeft(void) { + command(LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVELEFT); +} +void LiquidCrystal::scrollDisplayRight(void) { + command(LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVERIGHT); +} + +// This is for text that flows Left to Right +void LiquidCrystal::leftToRight(void) { + _displaymode |= LCD_ENTRYLEFT; + command(LCD_ENTRYMODESET | _displaymode); +} + +// This is for text that flows Right to Left +void LiquidCrystal::rightToLeft(void) { + _displaymode &= ~LCD_ENTRYLEFT; + command(LCD_ENTRYMODESET | _displaymode); +} + +// This will 'right justify' text from the cursor +void LiquidCrystal::autoscroll(void) { + _displaymode |= LCD_ENTRYSHIFTINCREMENT; + command(LCD_ENTRYMODESET | _displaymode); +} + +// This will 'left justify' text from the cursor +void LiquidCrystal::noAutoscroll(void) { + _displaymode &= ~LCD_ENTRYSHIFTINCREMENT; + command(LCD_ENTRYMODESET | _displaymode); +} + +// Allows us to fill the first 8 CGRAM locations +// with custom characters +void LiquidCrystal::createChar(uint8_t location, uint8_t charmap[]) { + location &= 0x7; // we only have 8 locations 0-7 + command(LCD_SETCGRAMADDR | (location << 3)); + for (int i=0; i<8; i++) { + write(charmap[i]); + } +} + +/*********** mid level commands, for sending data/cmds */ + +inline void LiquidCrystal::command(uint8_t value) { + send(value, LOW); +} + +inline size_t LiquidCrystal::write(uint8_t value) { + send(value, HIGH); + return 1; // assume success +} + +/************ low level data pushing commands **********/ + +// write either command or data, with automatic 4/8-bit selection +void LiquidCrystal::send(uint8_t value, uint8_t mode) { + digitalWrite(_rs_pin, mode); + + // if there is a RW pin indicated, set it low to Write + if (_rw_pin != 255) { + digitalWrite(_rw_pin, LOW); + } + + if (_displayfunction & LCD_8BITMODE) { + write8bits(value); + } else { + write4bits(value>>4); + write4bits(value); + } +} + +void LiquidCrystal::pulseEnable(void) { + digitalWrite(_enable_pin, LOW); + delayMicroseconds(1); + digitalWrite(_enable_pin, HIGH); + delayMicroseconds(1); // enable pulse must be >450 ns + digitalWrite(_enable_pin, LOW); + delayMicroseconds(100); // commands need >37 us to settle +} + +void LiquidCrystal::write4bits(uint8_t value) { + for (int i = 0; i < 4; i++) { + digitalWrite(_data_pins[i], (value >> i) & 0x01); + } + + pulseEnable(); +} + +void LiquidCrystal::write8bits(uint8_t value) { + for (int i = 0; i < 8; i++) { + digitalWrite(_data_pins[i], (value >> i) & 0x01); + } + + pulseEnable(); +} \ No newline at end of file diff --git a/extensions/lcd_keypad_shield/lib/Arduino-LiquidCrystal-library/LiquidCrystal.h b/extensions/lcd_keypad_shield/lib/Arduino-LiquidCrystal-library/LiquidCrystal.h new file mode 100644 index 00000000..c2a79fa4 --- /dev/null +++ b/extensions/lcd_keypad_shield/lib/Arduino-LiquidCrystal-library/LiquidCrystal.h @@ -0,0 +1,108 @@ +#ifndef LiquidCrystal_h +#define LiquidCrystal_h + +#include +#include "Print.h" + +// commands +#define LCD_CLEARDISPLAY 0x01 +#define LCD_RETURNHOME 0x02 +#define LCD_ENTRYMODESET 0x04 +#define LCD_DISPLAYCONTROL 0x08 +#define LCD_CURSORSHIFT 0x10 +#define LCD_FUNCTIONSET 0x20 +#define LCD_SETCGRAMADDR 0x40 +#define LCD_SETDDRAMADDR 0x80 + +// flags for display entry mode +#define LCD_ENTRYRIGHT 0x00 +#define LCD_ENTRYLEFT 0x02 +#define LCD_ENTRYSHIFTINCREMENT 0x01 +#define LCD_ENTRYSHIFTDECREMENT 0x00 + +// flags for display on/off control +#define LCD_DISPLAYON 0x04 +#define LCD_DISPLAYOFF 0x00 +#define LCD_CURSORON 0x02 +#define LCD_CURSOROFF 0x00 +#define LCD_BLINKON 0x01 +#define LCD_BLINKOFF 0x00 + +// flags for display/cursor shift +#define LCD_DISPLAYMOVE 0x08 +#define LCD_CURSORMOVE 0x00 +#define LCD_MOVERIGHT 0x04 +#define LCD_MOVELEFT 0x00 + +// flags for function set +#define LCD_8BITMODE 0x10 +#define LCD_4BITMODE 0x00 +#define LCD_2LINE 0x08 +#define LCD_1LINE 0x00 +#define LCD_5x10DOTS 0x04 +#define LCD_5x8DOTS 0x00 + +class LiquidCrystal : public Print { +public: + LiquidCrystal(uint8_t rs, uint8_t enable, + uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, + uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7); + LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable, + uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, + uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7); + LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable, + uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3); + LiquidCrystal(uint8_t rs, uint8_t enable, + uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3); + + void init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t enable, + uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3, + uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7); + + void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS); + + void clear(); + void home(); + + void noDisplay(); + void display(); + void noBlink(); + void blink(); + void noCursor(); + void cursor(); + void scrollDisplayLeft(); + void scrollDisplayRight(); + void leftToRight(); + void rightToLeft(); + void autoscroll(); + void noAutoscroll(); + + void setRowOffsets(int row1, int row2, int row3, int row4); + void createChar(uint8_t, uint8_t[]); + void setCursor(uint8_t, uint8_t); + virtual size_t write(uint8_t); + void command(uint8_t); + + using Print::write; +private: + void send(uint8_t, uint8_t); + void write4bits(uint8_t); + void write8bits(uint8_t); + void pulseEnable(); + + uint8_t _rs_pin; // LOW: command. HIGH: character. + uint8_t _rw_pin; // LOW: write to LCD. HIGH: read from LCD. + uint8_t _enable_pin; // activated by a HIGH pulse. + uint8_t _data_pins[8]; + + uint8_t _displayfunction; + uint8_t _displaycontrol; + uint8_t _displaymode; + + uint8_t _initialized; + + uint8_t _numlines; + uint8_t _row_offsets[4]; +}; + +#endif \ No newline at end of file diff --git a/extensions/lcd_keypad_shield/lib/Arduino-LiquidCrystal-library/keywords.txt b/extensions/lcd_keypad_shield/lib/Arduino-LiquidCrystal-library/keywords.txt new file mode 100644 index 00000000..0fc39211 --- /dev/null +++ b/extensions/lcd_keypad_shield/lib/Arduino-LiquidCrystal-library/keywords.txt @@ -0,0 +1,37 @@ +####################################### +# Syntax Coloring Map For LiquidCrystal +####################################### + +####################################### +# Datatypes (KEYWORD1) +####################################### + +LiquidCrystal KEYWORD1 LiquidCrystal + +####################################### +# Methods and Functions (KEYWORD2) +####################################### + +begin KEYWORD2 +clear KEYWORD2 +home KEYWORD2 +print KEYWORD2 +setCursor KEYWORD2 +cursor KEYWORD2 +noCursor KEYWORD2 +blink KEYWORD2 +noBlink KEYWORD2 +display KEYWORD2 +noDisplay KEYWORD2 +autoscroll KEYWORD2 +noAutoscroll KEYWORD2 +leftToRight KEYWORD2 +rightToLeft KEYWORD2 +scrollDisplayLeft KEYWORD2 +scrollDisplayRight KEYWORD2 +createChar KEYWORD2 +setRowOffsets KEYWORD2 + +####################################### +# Constants (LITERAL1) +####################################### diff --git a/extensions/lcd_keypad_shield/toolbox.js b/extensions/lcd_keypad_shield/toolbox.js new file mode 100644 index 00000000..880b1c21 --- /dev/null +++ b/extensions/lcd_keypad_shield/toolbox.js @@ -0,0 +1,47 @@ +/* eslint-disable func-style */ +/* eslint-disable max-len */ +/* eslint-disable require-jsdoc */ +function registerToolboxs () { + return ` + + + + + + + 0 + + + + + 0 + + + + + + + Hello OpenBlock + + + + + + + + + + + + + + + + + + + +`; +} + +exports = registerToolboxs; diff --git a/extensions/lcd_keypad_shield/translations.js b/extensions/lcd_keypad_shield/translations.js new file mode 100644 index 00000000..13f12071 --- /dev/null +++ b/extensions/lcd_keypad_shield/translations.js @@ -0,0 +1,135 @@ +// This file was automatically generated. Do not modify. +/* eslint-disable func-style */ +/* eslint-disable require-jsdoc */ +/* eslint-disable quotes */ +/* eslint-disable quote-props */ +/* eslint-disable dot-notation */ +/* eslint-disable max-len */ +function getInterfaceTranslations () { + return { + "en": { + "lcdks.name": "LCD Keypad Shield", + "lcdks.description": "1602 liquid crystal display with keypad contains 5 keys." + }, + "ru": { + "lcdks.name": "LCD клавиатурный щит", + "lcdks.description": "1602 жидкокристаллический дисплей с клавиатурой содержит 5 клавиш." + }, + "zh-cn": { + "lcdks.name": "液晶鍵盤面板", + "lcdks.description": "1602液晶显示器,带有5个按键。" + }, + "zh-tw": { + "lcdks.name": "液晶鍵盤面板", + "lcdks.description": "帶有5個按鍵的1602液晶顯示模組。" + } + }; +} + +function registerScratchExtensionTranslations () { + return {}; +} + +function registerBlocksMessages (Blockly) { + Object.assign(Blockly.ScratchMsgs.locales["en"], + { + "LCD_CATEGORY": "LCD Keypad Shield", + "LCD_INIT": "Initialize LCD Keypad Shield", + "LCD_SETCURSORPOSITION": "Set LCD cursor position x: %1 y: %2", + "LCD_PRINT": "LCD display %1", + "LCD_CLEAR": "Clear LCD display", + "LCD_SETBACKLIGHT": "Set LCD backlight %1", + "LCD_SATE_ON": "On", + "LCD_SATE_OFF": "Off", + "LCD_SETCURSORSTYLE": "Set LCD cursor %1 style %2", + "LCD_SATE_DISPLAY": "Display", + "LCD_SATE_HIDE": "Hide", + "LCD_STYLE_BLINK": "Blink", + "LCD_STYLE_NOBLINK": "No Blink", + "LCD_UP": "Up pressed", + "LCD_DOWN": "Down pressed", + "LCD_LEFT": "Left pressed", + "LCD_RIGHT": "Right pressed", + "LCD_SELECT": "Select pressed" + } + + ); + + Object.assign(Blockly.ScratchMsgs.locales["ru"], + { + "LCD_CATEGORY": "LCD клавиатурный щит", + "LCD_INIT": "инициализация LCD клавиатурного щита", + "LCD_SETCURSORPOSITION": "установить позицию курсора LCD x: %1 y: %2", + "LCD_PRINT": "печать на LCD %1", + "LCD_CLEAR": "очистить LCD", + "LCD_SETBACKLIGHT": "установить подсветку LCD %1", + "LCD_SATE_ON": "включено", + "LCD_SATE_OFF": "выключено", + "LCD_SETCURSORSTYLE": "установить стиль курсора LCD %1 %2", + "LCD_SATE_DISPLAY": "отображение", + "LCD_SATE_HIDE": "скрыть", + "LCD_STYLE_BLINK": "мигание", + "LCD_STYLE_NOBLINK": "не мигать", + "LCD_UP": "нажата вверх", + "LCD_DOWN": "нажата вниз", + "LCD_LEFT": "нажата влево", + "LCD_RIGHT": "нажата вправо", + "LCD_SELECT": "выбрана кнопка" + } + ); + + Object.assign(Blockly.ScratchMsgs.locales["zh-cn"], + { + "LCD_CATEGORY": "液晶键盘面板", + "LCD_INIT": "初始化液晶键盘面板", + "LCD_SETCURSORPOSITION": "设置液晶显示器光标位置 x: %1 y: %2", + "LCD_PRINT": "液晶显示器显示 %1", + "LCD_CLEAR": "清空液晶显示器", + "LCD_SETBACKLIGHT": "设置液晶显示器背光 %1", + "LCD_SATE_ON": "开", + "LCD_SATE_OFF": "关", + "LCD_SETCURSORSTYLE": "设置液晶显示器光标 %1 样式 %2", + "LCD_SATE_DISPLAY": "显示", + "LCD_SATE_HIDE": "隐藏", + "LCD_STYLE_BLINK": "闪烁", + "LCD_STYLE_NOBLINK": "不闪烁", + "LCD_READKEY": "读取键盘信号", + "LCD_UP": "上被按下", + "LCD_DOWN": "下被按下", + "LCD_LEFT": "左被按下", + "LCD_RIGHT": "右被按下", + "LCD_SELECT": "选择被按下" + } + ); + + Object.assign(Blockly.ScratchMsgs.locales["zh-tw"], + { + "LCD_CATEGORY": "液晶鍵盤面板", + "LCD_INIT": "初始化液晶鍵盤面板", + "LCD_SETCURSORPOSITION": "設置液晶顯示器光標位置 x: %1 y: %2", + "LCD_PRINT": "液晶顯示器顯示 %1", + "LCD_CLEAR": "清空液晶顯示器", + "LCD_SETBACKLIGHT": "設置液晶顯示器背光 %1", + "LCD_SATE_ON": "開", + "LCD_SATE_OFF": "關", + "LCD_SETCURSORSTYLE": "設置液晶顯示器光標 %1 樣式 %2", + "LCD_SATE_DISPLAY": "顯示", + "LCD_SATE_HIDE": "隱藏", + "LCD_STYLE_BLINK": "閃爍", + "LCD_STYLE_NOBLINK": "不閃爍", + "LCD_UP": "上被按下", + "LCD_DOWN": "下被按下", + "LCD_LEFT": "左被按下", + "LCD_RIGHT": "右被按下", + "LCD_SELECT": "選擇被按下" + } + ); + + return Blockly; +} + +if (typeof module !== 'undefined') { + module.exports = {getInterfaceTranslations}; +} +exports = registerScratchExtensionTranslations; +exports = registerBlocksMessages; diff --git a/extensions/max30102/index.js b/extensions/max30102/index.js index a8932cb5..048ca9c5 100644 --- a/extensions/max30102/index.js +++ b/extensions/max30102/index.js @@ -6,7 +6,7 @@ const max30102 = formatMessage => ({ extensionId: 'max30102', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266'], + 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/max30102.png`, description: formatMessage({ diff --git a/extensions/max6675/index.js b/extensions/max6675/index.js index 42bf798e..56f9788b 100644 --- a/extensions/max6675/index.js +++ b/extensions/max6675/index.js @@ -6,7 +6,7 @@ const max6675 = formatMessage => ({ extensionId: 'max6675', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266'], + 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/max6675.png`, description: formatMessage({ diff --git a/extensions/mfrc522/index.js b/extensions/mfrc522/index.js index 213b01ac..2baca0a0 100644 --- a/extensions/mfrc522/index.js +++ b/extensions/mfrc522/index.js @@ -6,7 +6,7 @@ const mfrc522 = formatMessage => ({ extensionId: 'mfrc522', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266'], + 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/mfrc522.png`, description: formatMessage({ diff --git a/extensions/moreComments/index.js b/extensions/moreComments/index.js index bc94017b..30880a01 100644 --- a/extensions/moreComments/index.js +++ b/extensions/moreComments/index.js @@ -6,7 +6,7 @@ const moreComments = formatMessage => ({ extensionId: 'moreComments', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266'], + 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/moreComments.png`, description: formatMessage({ diff --git a/extensions/mpu6050/index.js b/extensions/mpu6050/index.js index 069a0581..397fed25 100644 --- a/extensions/mpu6050/index.js +++ b/extensions/mpu6050/index.js @@ -6,7 +6,7 @@ const mpu6050 = formatMessage => ({ extensionId: 'mpu6050', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266'], + 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/mpu6050.png`, description: formatMessage({ diff --git a/extensions/nrf24l01/index.js b/extensions/nrf24l01/index.js index 0c63a9f4..5b587472 100644 --- a/extensions/nrf24l01/index.js +++ b/extensions/nrf24l01/index.js @@ -3,7 +3,7 @@ const nrf24l01 = formatMessage => ({ extensionId: 'nrf24l01', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp8266', 'arduinoEsp32'], + 'arduinoMega2560', 'arduinoEsp8266', 'arduinoEsp32', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/nrf24l01.png`, description: formatMessage({ diff --git a/extensions/oled/index.js b/extensions/oled/index.js index 5c18faf8..63927560 100644 --- a/extensions/oled/index.js +++ b/extensions/oled/index.js @@ -3,7 +3,7 @@ const oled = formatMessage => ({ extensionId: 'oled', version: '0.0.1', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266'], + 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/oled.png`, description: formatMessage({ diff --git a/extensions/passiveBuzzer/index.js b/extensions/passiveBuzzer/index.js index afa55159..96d15cbf 100644 --- a/extensions/passiveBuzzer/index.js +++ b/extensions/passiveBuzzer/index.js @@ -6,7 +6,7 @@ const passiveBuzzer = formatMessage => ({ extensionId: 'passiveBuzzer', version: '2.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp8266'], + 'arduinoMega2560', 'arduinoEsp8266', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/passiveBuzzer.png`, description: formatMessage({ diff --git a/extensions/pca9685/index.js b/extensions/pca9685/index.js index 72fc7028..7879d163 100644 --- a/extensions/pca9685/index.js +++ b/extensions/pca9685/index.js @@ -6,7 +6,7 @@ const pca9685 = formatMessage => ({ extensionId: 'pca9685', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266'], + 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/pca9685.png`, description: formatMessage({ diff --git a/extensions/ps2/index.js b/extensions/ps2/index.js index 7ca8633e..2cc15c1c 100644 --- a/extensions/ps2/index.js +++ b/extensions/ps2/index.js @@ -6,7 +6,7 @@ const ps2 = formatMessage => ({ extensionId: 'ps2', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266'], + 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/ps2.png`, description: formatMessage({ diff --git a/extensions/rgbLedStrip/index.js b/extensions/rgbLedStrip/index.js index a362d202..8c13d2c1 100644 --- a/extensions/rgbLedStrip/index.js +++ b/extensions/rgbLedStrip/index.js @@ -6,7 +6,7 @@ const rgbLedStrip = formatMessage => ({ extensionId: 'rgbLedStrip', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp8266', 'arduinoEsp32'], + 'arduinoMega2560', 'arduinoEsp8266', 'arduinoEsp32', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/rgbLedStrip.png`, description: formatMessage({ diff --git a/extensions/sdCard/index.js b/extensions/sdCard/index.js index fbd943f4..b20aa1a9 100644 --- a/extensions/sdCard/index.js +++ b/extensions/sdCard/index.js @@ -6,7 +6,7 @@ const sdCard = formatMessage => ({ extensionId: 'sdCard', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266'], + 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/sdCard.png`, description: formatMessage({ diff --git a/extensions/sharpIR/index.js b/extensions/sharpIR/index.js index 680de284..bf9fd5df 100644 --- a/extensions/sharpIR/index.js +++ b/extensions/sharpIR/index.js @@ -6,7 +6,7 @@ const sharpIR = formatMessage => ({ extensionId: 'sharpIR', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp8266'], + 'arduinoMega2560', 'arduinoEsp8266', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/sharpIR.png`, description: formatMessage({ diff --git a/extensions/shiftDigitDisplay/index.js b/extensions/shiftDigitDisplay/index.js index d96437ac..830a80e2 100644 --- a/extensions/shiftDigitDisplay/index.js +++ b/extensions/shiftDigitDisplay/index.js @@ -6,7 +6,7 @@ const shiftDigitDisplay = formatMessage => ({ extensionId: 'shiftDigitDisplay', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp8266', 'arduinoEsp32'], + 'arduinoMega2560', 'arduinoEsp8266', 'arduinoEsp32', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/shiftDigitDisplay.png`, description: formatMessage({ diff --git a/extensions/softwareSerialport/index.js b/extensions/softwareSerialport/index.js index 6fa8e209..4466eeae 100644 --- a/extensions/softwareSerialport/index.js +++ b/extensions/softwareSerialport/index.js @@ -5,7 +5,7 @@ const softwareSerial = formatMessage => ({ }), extensionId: 'softwareSerial', version: '1.0.0', - supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', 'arduinoMega2560'], + supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', 'arduinoMega2560', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/softwareSerial.png`, description: formatMessage({ diff --git a/extensions/tcs3200/index.js b/extensions/tcs3200/index.js index 717ed55a..9d379c1c 100644 --- a/extensions/tcs3200/index.js +++ b/extensions/tcs3200/index.js @@ -3,7 +3,7 @@ const tcs3200 = formatMessage => ({ extensionId: 'tcs3200', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560'], + 'arduinoMega2560', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/tcs3200.png`, description: formatMessage({ diff --git a/extensions/u8g2/index.js b/extensions/u8g2/index.js index eafef06c..db78c523 100644 --- a/extensions/u8g2/index.js +++ b/extensions/u8g2/index.js @@ -3,7 +3,7 @@ const u8g2 = formatMessage => ({ extensionId: 'u8g2', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp8266', 'arduinoEsp32'], + 'arduinoMega2560', 'arduinoEsp8266', 'arduinoEsp32', 'lgt8f328pNano'], author: 'ArthurZheng', iconURL: `assets/u8g2.png`, description: formatMessage({ diff --git a/extensions/ultrasonic/index.js b/extensions/ultrasonic/index.js index ef0945af..e3f27495 100644 --- a/extensions/ultrasonic/index.js +++ b/extensions/ultrasonic/index.js @@ -6,7 +6,7 @@ const ultrasonic = formatMessage => ({ extensionId: 'ultrasonic', version: '1.0.0', supportDevice: ['arduinoUno', 'arduinoNano', 'arduinoLeonardo', - 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266'], + 'arduinoMega2560', 'arduinoEsp32', 'arduinoEsp8266', 'lgt8f328pNano'], author: 'Liang', iconURL: `assets/ultrasonic.png`, description: formatMessage({