Skip to content

Commit

Permalink
Merge pull request #658 from entrylabs/develop-hw
Browse files Browse the repository at this point in the history
1.9.45 버전업 2차
  • Loading branch information
Tnks2U authored Aug 24, 2023
2 parents 44441a7 + 426488c commit 5df547b
Show file tree
Hide file tree
Showing 11 changed files with 3,941 additions and 3,874 deletions.
Binary file modified app/firmwares/0uboard.bin
Binary file not shown.
2,225 changes: 1,110 additions & 1,115 deletions app/firmwares/dalgona.hex

Large diffs are not rendered by default.

3,922 changes: 1,983 additions & 1,939 deletions app/firmwares/roborobo_cube.hex

Large diffs are not rendered by default.

1,585 changes: 798 additions & 787 deletions app/firmwares/runcoding.hex

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/modules/0uboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function Module() {
OLED: 241,
COM: 242,
NEOPIXEL: 243,
ULTRASONIC_COUNTER: 244,
//ULTRASONIC_COUNTER: 244,
DOTMATRIX: 245
}

Expand Down
19 changes: 14 additions & 5 deletions app/modules/asomebot.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,20 @@
],
"icon": "asomebot.png",
"module": "asomebot.js",
"driver": {
"win32-ia32": "CP210x_VCP_Windows/CP210xVCPInstaller_x86.exe",
"win32-x64": "CP210x_VCP_Windows/CP210xVCPInstaller_x64.exe",
"darwin-x64": "Mac_OSX_VCP_Driver/SiLabsUSBDriverDisk.dmg"
},
"driver": [
{
"win32-ia32": "CP210x_VCP_Windows/CP210xVCPInstaller_x86.exe",
"win32-x64": "CP210x_VCP_Windows/CP210xVCPInstaller_x64.exe",
"darwin-x64": "Mac_OSX_VCP_Driver/SiLabsUSBDriverDisk.dmg",
"translate": "USB 드라이버 "
},
{
"win32-ia32": "CH34x_Install_Windows_v3_4/CH34x_Install_Windows_v3_4.EXE",
"win32-x64": "CH34x_Install_Windows_v3_4/CH34x_Install_Windows_v3_4.EXE",
"darwin-x64": "https://entrylabs.github.io/docs/files/drivers/CH34x_Install_MAC_10_9_AND_ABOVE/CH34x_Install_V1.3.pkg",
"translate": "CH340 드라이버"
}
],
"selectPort": true,
"reconnect": true,
"hardware": {
Expand Down
19 changes: 14 additions & 5 deletions app/modules/asomekit.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,20 @@
],
"icon": "asomekit.png",
"module": "asomekit.js",
"driver": {
"win32-ia32": "CP210x_VCP_Windows/CP210xVCPInstaller_x86.exe",
"win32-x64": "CP210x_VCP_Windows/CP210xVCPInstaller_x64.exe",
"darwin-x64": "Mac_OSX_VCP_Driver/SiLabsUSBDriverDisk.dmg"
},
"driver": [
{
"win32-ia32": "CP210x_VCP_Windows/CP210xVCPInstaller_x86.exe",
"win32-x64": "CP210x_VCP_Windows/CP210xVCPInstaller_x64.exe",
"darwin-x64": "Mac_OSX_VCP_Driver/SiLabsUSBDriverDisk.dmg",
"translate": "USB 드라이버 "
},
{
"win32-ia32": "CH34x_Install_Windows_v3_4/CH34x_Install_Windows_v3_4.EXE",
"win32-x64": "CH34x_Install_Windows_v3_4/CH34x_Install_Windows_v3_4.EXE",
"darwin-x64": "https://entrylabs.github.io/docs/files/drivers/CH34x_Install_MAC_10_9_AND_ABOVE/CH34x_Install_V1.3.pkg",
"translate": "CH340 드라이버"
}
],
"selectPort": true,
"reconnect": true,
"hardware": {
Expand Down
34 changes: 17 additions & 17 deletions app/modules/dalgona.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,15 +345,18 @@ Module.prototype.requestLocalData = function () {
/*
ff 55 idx size data a
*/

// 펌웨어에서 입력된 값을 처리하는 Buffer
Module.prototype.handleLocalData = function (data) {
const self = this;
const datas = this.getDataByBuffer(data);

// console.log(datas);
datas.forEach((data) => {
if (data.length <= 4 || data[0] !== 255 || data[1] !== 85) {
return;
}
const readData = data.subarray(2, data.length);
// console.log(readData);
let value;
switch (readData[0]) {
case self.sensorValueSize.FLOAT: {
Expand All @@ -380,7 +383,10 @@ Module.prototype.handleLocalData = function (data) {

const type = readData[readData.length - 1];
const port = readData[readData.length - 2];

// if(port == 9)
// {
// console.log(readData);
// }
switch (type) {
case self.sensorTypes.DIGITAL: {
self.sensorData.DIGITAL[port] = value;
Expand Down Expand Up @@ -408,8 +414,6 @@ Module.prototype.handleLocalData = function (data) {
}
case self.sensorTypes.ULTRASONIC: {
self.sensorData.ULTRASONIC[port] = value;
// console.log(port);
// console.log(self.sensorData.ULTRASONIC[port]);
break;
}
case self.sensorTypes.DUST: {
Expand All @@ -426,14 +430,12 @@ Module.prototype.handleLocalData = function (data) {
}
case self.sensorTypes.RFIDTAP: {
self.sensorData.RFIDTAP = value;
// console.log('RFIDTAP');
// console.log(value);
break;
}
case self.sensorTypes.RFIDVALUE: {
value = value.substring(0, value.length - 1); //마지막에 쓰레기값 출력X
self.sensorData.RFIDVALUE = value;
// console.log(value);
// console.log(readData);
break;
}
case self.sensorTypes.MLXOBJ: {
Expand All @@ -455,20 +457,17 @@ Module.prototype.handleLocalData = function (data) {
ff 55 len idx action device port slot data a
0 1 2 3 4 5 6 7 8
*/

// 엔트리 블럭 화면에서 입력에 해당하는 블럭을 사용했을 때, 펌웨어쪽으로 보내는 Buffer
Module.prototype.makeSensorReadBuffer = function (device, port, data) {
let buffer;
const dummy = new Buffer([10]);
if (device == this.sensorTypes.DIGITAL) {
//data 2: pull up, 0: normal
//console.log(data)
buffer = new Buffer([255, 85, 6, sensorIdx, this.actionTypes.GET, device, port, data, 10]);
} else if (device == this.sensorTypes.PULLUP) {
//data 2: pull up, 0: normal
//console.log(data)
//pullup인 경우
buffer = new Buffer([255, 85, 6, sensorIdx, this.actionTypes.GET, device, port, data, 10]);
//console.log(buffer);
} else if (device == this.sensorTypes.RFIDTAP) {
buffer = new Buffer([255, 85, 5, sensorIdx, this.actionTypes.GET, device, port, 10]);
} else if (device == this.sensorTypes.ULTRASONIC) {
Expand Down Expand Up @@ -524,6 +523,8 @@ Module.prototype.makeSensorReadBuffer = function (device, port, data) {
};

//0xff 0x55 0x6 0x0 0x1 0xa 0x9 0x0 0x0 0xa

// 엔트리 블럭 화면에서 출력에 해당하는 블럭을 사용했을 때, 펌웨어쪽으로 보내는 Buffer
Module.prototype.makeOutputBuffer = function (device, port, data) {
let buffer;
const value = new Buffer(2);
Expand Down Expand Up @@ -684,13 +685,12 @@ Module.prototype.makeOutputBuffer = function (device, port, data) {

// buffer = Buffer.from([255, 85, 26, sensorIdx, this.actionTypes.MODUEL, device, port]);
// buffer = Buffer.concat([buffer, fndBlockIndex, fndClk, fndDio, fndBrightnessLev, fndOnOff, fndDisplayStrLength, fndDisplayStr0, fndDisplayStr1, fndDisplayStr2, fndDisplayStr3, fndDelayMs, dummy]);
// console.log(buffer);

// break;
// }


case this.sensorTypes.NEOPIXELINIT: {
console.log('NEOPIXELINIT');
value.writeInt16LE(data);
buffer = new Buffer([255, 85, 6, sensorIdx, this.actionTypes.SET, device, port]);
buffer = Buffer.concat([buffer, value, dummy]);
Expand Down Expand Up @@ -914,7 +914,6 @@ Module.prototype.makeOutputBuffer = function (device, port, data) {
case this.sensorTypes.DOTMATRIXCLEAR: {
buffer = new Buffer([255, 85, 4, sensorIdx, this.actionTypes.SET, device, port]);
buffer = Buffer.concat([buffer, dummy]);
console.log(buffer);
break;
}
case this.sensorTypes.LCDINIT: {
Expand Down Expand Up @@ -946,7 +945,6 @@ Module.prototype.makeOutputBuffer = function (device, port, data) {

if ($.isPlainObject(data)) {
textLen = ('' + data.text).length;
// console.log(textLen);
text = Buffer.from('' + data.text, 'ascii');
line.writeInt16LE(data.line);
textLenBuf.writeInt16LE(textLen);
Expand Down Expand Up @@ -1064,7 +1062,6 @@ Module.prototype.makeOutputBuffer = function (device, port, data) {
} else {
num.writeFloatLE(0);
}
console.log(num);
buffer = new Buffer([255, 85, 8, sensorIdx, this.actionTypes.SET, device, port]);
buffer = Buffer.concat([buffer, num, dummy]);

Expand Down Expand Up @@ -1096,6 +1093,9 @@ Module.prototype.getDataByBuffer = function (buffer) {
if (value == 13 && buffer[idx + 1] == 10) {
datas.push(buffer.subarray(lastIndex, idx));
lastIndex = idx + 2;
// if(buffer[idx-1] == 9)
// console.log(datas);

}
});

Expand All @@ -1119,4 +1119,4 @@ Module.prototype.reset = function () {

Module.prototype.lostController = function () {};

module.exports = new Module();
module.exports = new Module();
4 changes: 2 additions & 2 deletions app/modules/dalgona.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "540101",
"name": {
"en": "dalgona board",
"ko": "달고나 제어보드"
"en": "Dalgona.Edu Plus",
"ko": "달고나.에듀 Plus"
},
"category": "board",
"platform": ["win32", "darwin"],
Expand Down
5 changes: 2 additions & 3 deletions app/modules/runcoding.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "170101",
"name": {
"en": "runcoding",
"ko": "런코딩"
"ko": "코마크레 런코딩"
},
"category": "board",
"platform": ["win32", "darwin"],
Expand All @@ -17,13 +17,12 @@
"email": "[email protected]",
"reconnect": true,
"firmware": "runcoding",
"selectPort": true,
"hardware": {
"type": "serial",
"control": "slave",
"duration": 32,
"vendor": ["Arduino", "wch.cn", "FTDI"],
"baudRate": 115200,
"baudRate": 38400,
"firmwarecheck": false,
"byteDelimiter": [13, 10]
}
Expand Down
Binary file modified app/modules/runcoding.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5df547b

Please sign in to comment.