Skip to content

Commit

Permalink
Merge pull request #666 from entrylabs/develop-hw
Browse files Browse the repository at this point in the history
1.9.46 버전업
  • Loading branch information
Tnks2U authored Sep 19, 2023
2 parents 5df547b + 9416688 commit bb34332
Show file tree
Hide file tree
Showing 15 changed files with 492 additions and 52 deletions.
Binary file not shown.
Binary file added app/drivers/robotry/Parodule_Firmware.exe
Binary file not shown.
Binary file modified app/firmwares/0uboard.bin
Binary file not shown.
Binary file added app/firmwares/examples/0uboard.bin
Binary file not shown.
52 changes: 47 additions & 5 deletions 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 Expand Up @@ -80,6 +80,7 @@ function Module() {
}

var sensorIdx = 0;
var cnt =0;

Module.prototype.init = function(handler, config) {
};
Expand Down Expand Up @@ -560,21 +561,22 @@ Module.prototype.makeOutputBuffer = function(device, port, data) {
var brig = new Buffer(1);

//var msgLength = data.length + 3;
mode[0] = data.mode; //네오픽셀 모드
index[0] = data.index; //네오픽셀 인덱스
value[0] = data.value; //갯수
mode[0] = data.mode; //네오픽셀 모드 7
index[0] = data.index; //네오픽셀 인덱스 8
value[0] = data.value; //갯수 9
pos[0] = data.pos; //위치
red[0] = data.red; //빨강
blue[0] = data.blue; //파랑
green[0] = data.green; //녹색
brig[0] = data.brig; //밝기



if(mode[0] == 1)
{
buffer = new Buffer([255, 85, 7, sensorIdx, this.actionTypes.SET, device, port]);
buffer = Buffer.concat([buffer, mode, index, value, dummy]);
}

else if (mode[0] ==2) {
buffer = new Buffer([255, 85, 11, sensorIdx, this.actionTypes.SET, device, 0]);
buffer = Buffer.concat([buffer, mode, index, pos, red, green, blue, brig, dummy]);
Expand All @@ -585,10 +587,50 @@ Module.prototype.makeOutputBuffer = function(device, port, data) {
} else {
buffer = new Buffer([255, 85, 06, sensorIdx, this.actionTypes.SET, device, 0, 4, 1]);
}

//
//buffer = new Buffer([255, 85, 11, sensorIdx, this.actionTypes.SET, device, 0, 2, 1, 5, 255, 1, 1, 55]);
break;
}
// case this.sensorTypes.DOTMATRIX: {

// var mode = new Buffer(1);
// var index = new Buffer(1);
// var value = new Buffer(1);
// var pos = new Buffer(1);
// var red = new Buffer(1);
// var add_value = new Buffer(1);

// //var msgLength = data.length + 3;
// mode[0] = data.mode; //네오픽셀 모드 7
// index[0] = data.index; //네오픽셀 인덱스 8
// value[0] = data.value; //갯수 9
// pos[0] = data.pos; //위치
// red[0] = data.red; //빨강

// if (mode[0] == 3) {
// if(cnt < 8)
// {
// add_value[0] =+ red[0];
// cnt++
// }

// if(cnt == 7)
// {
// buffer = new Buffer([255, 85, 10, sensorIdx, this.actionTypes.SET, device, 0]);
// buffer = Buffer.concat([buffer, mode, index, add_value, dummy]);
// cnt = 0;
// }else {
// buffer = new Buffer([255, 85, 06, sensorIdx, this.actionTypes.SET, device, 0, 4, 1]);

// }
// }

// //
// //buffer = new Buffer([255, 85, 11, sensorIdx, this.actionTypes.SET, device, 0, 2, 1, 5, 255, 1, 1, 55]);
// break;
// }

}

return buffer;
Expand Down
65 changes: 65 additions & 0 deletions app/modules/ProboConnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,28 @@ class ProboConnect extends BaseModule {
EC:0,
EEPR2:0,
EEPR1:0
},
Infinite:{
ROTATION_1:0,
ROTATION_2:0,
ROTATION_3:0,
ROTATION_4:0
},
Acceler:{
AXIS_X1:0,
AXIS_X2:0,
AXIS_X3:0,
AXIS_X4:0,
AXIS_Y1:0,
AXIS_Y2:0,
AXIS_Y3:0,
AXIS_Y4:0,
AXIS_Z1:0,
AXIS_Z2:0,
AXIS_Z3:0,
AXIS_Z4:0,
}

};

this.RemoteData = {
Expand All @@ -87,6 +108,10 @@ class ProboConnect extends BaseModule {
ASET1:0
};

// this.Infinite_Buff = { AA1: 0, AA2: 0, AA3: 0, AA4: 0 },
// this.Infinite_Count = { AA1: 0, AA2: 0, AA3: 0, AA4: 0 },
// this.Infinite_Start = { AA1: 0, AA2: 0, AA3: 0, AA4: 0 },

this.OutputData = new Buffer(22);

this.OutputData[0] = 0xAD;
Expand Down Expand Up @@ -273,13 +298,53 @@ class ProboConnect extends BaseModule {
this.InputData.EEPROM.EC = data[13];
this.InputData.EEPROM.EEPR2 = data[14];
this.InputData.EEPROM.EEPR1 = data[15];

this.InputData.Infinite.ROTATION_1 = (data[16]>>6)&0xC;
this.InputData.Infinite.ROTATION_2 = (data[16]>>4)&0xC;
this.InputData.Infinite.ROTATION_3 = (data[16]>>2)&0xC;
this.InputData.Infinite.ROTATION_4 = (data[16]>>0)&0xC;

this.InputData.Acceler.AXIS_X1 = data[4];
this.InputData.Acceler.AXIS_X2 = data[5];
this.InputData.Acceler.AXIS_X3 = data[6];
this.InputData.Acceler.AXIS_X4 = data[7];

this.InputData.Acceler.AXIS_Y1 = data[17];
this.InputData.Acceler.AXIS_Y2 = data[19];
this.InputData.Acceler.AXIS_Y3 = data[21];
this.InputData.Acceler.AXIS_Y4 = data[23];

this.InputData.Acceler.AXIS_Z1 = data[18];
this.InputData.Acceler.AXIS_Z2 = data[20];
this.InputData.Acceler.AXIS_Z3 = data[22];
this.InputData.Acceler.AXIS_Z4 = data[24];

}
else
console.count('CheckSum Err');
}
//this.sensors = data;
}

// 커스텀 버튼을 사용자에게 보여줄지 여부
canShowCustomButton() {
return true;
}

// 커스텀 버튼 클릭시 동작할 로직
customButtonClicked(key) {
switch (key) {
case "case1":
//버튼 1 로직
break;
case "case2":
//버튼 2 로직
break;
default:
console.log(key);
}
}

}

module.exports = new ProboConnect();
17 changes: 11 additions & 6 deletions app/modules/ProboConnect.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@
"en": "ProboConnect",
"ko": "프로보커넥트"
},
"category": "module",
"platform": ["win32"],
"icon" : "ProboConnect.png",
"module": "ProboConnect.js",
"driver": {
"driver": [{
"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"
},
"win32-x64": "CH34x_Install_Windows_v3_4/CH34x_Install_Windows_v3_4.exe",
"translate": "드라이버 설치"},
{
"win32-ia32": "Easy_Down_Entry/PROBO_Easy_Down_Entry_ver8.38_install.exe",
"win32-x64": "Easy_Down_Entry/PROBO_Easy_Down_Entry_ver8.38_install.exe",
"translate": "펌웨어 설치"}
],
"url": "https://www.probo.kr/",
"email": "alswn5609@naver.com",
"email": "tkddnjs10@naver.com",
"reconnect": true,
"selectPort": true,
"hardware": {
Expand All @@ -30,4 +34,5 @@
"delimiter" : "",
"flowControl" : "Connect"
}
}

}
Binary file modified app/modules/ProboConnect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 17 additions & 22 deletions app/modules/neo.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,39 @@ const FrameCode = {
};

const PduConnectionCode = {
PAIRING_START: 0x01,
MANUAL_PAIRING: 0x00,
AUTO_PAIRING: 0x01,
PAIRING_INFO: 0x03,
PAIRING_REMOVE: 0x06,
NOTIFY_LIVE: 0x07,
};

const PduBasicCode = {
SENSOR_DATA: 0x01,
CONTROLLER_CMD: 0x02,
BASIC: 0x10,
EXTEND_1: 0x11,
EXTEND_2: 0x12,
EXTEND_3: 0x13,
};

const SensorKind = {
CONTROLLER: 0x00,
ANALOG: 0x01,
COLOR: 0x02,
DISTANCE: 0x03,
TEMPERATURE: 0x04,
GYRO: 0x05,
DIGITAL: 0x02,
COLOR: 0x03,
};

const UnitId = {
CONTROLLER: 0x00,
CONTROLLER_IN1: 0x01,
CONTROLLER_IN2: 0x02,
CONTROLLER_IN3: 0x03,
SENSOR_STICK: 0x10,
SENSOR_STICK_IN1: 0x11,
IOT: 0x80,
CONTROLLER_OUT1: 0x81,
CONTROLLER_OUT2: 0x82,
CONTROLLER_OUT3: 0x83,
CONTROLLER_OUT12: 0x83,
CONTROLLER_OUT3: 0x84,
CONTROLLER_OUT123: 0x87,
};

class Neo extends BaseModule {
Expand All @@ -72,9 +73,6 @@ class Neo extends BaseModule {
in2Values: [0, 0, 0, 0],
in3Kind: 0,
in3Values: [0, 0, 0, 0],
sensorStickBattery: 0,
in4Kind: 0,
in4Values: [0, 0, 0, 0],
};
}

Expand Down Expand Up @@ -295,13 +293,10 @@ class Neo extends BaseModule {

this.logPdu(this.byteArrayToHex(pdu));

const responseData = this.parseResponsePdu(pdu);
if (responseData && responseData.blockId) {
if (this.pendingList[responseData.blockId]) {
if (responseData.result === 0x02) {
this.pendingList[responseData.blockId].state = 'pending';
}
if (responseData.result === 0x01) {
if (pdu[IDX_PDU_CODE] >= PduBasicCode.BASIC) {
const responseData = this.parseResponsePdu(pdu);
if (responseData && responseData.blockId) {
if (this.pendingList[responseData.blockId]) {
this.pendingList[responseData.blockId].state = 'completed';
}
}
Expand Down Expand Up @@ -336,7 +331,7 @@ class Neo extends BaseModule {
} else if (unitId === UnitId.CONTROLLER_IN3) {
this.sensorValues.in3Values = [analogValue, 0, 0, 0];
}
} else if (sensorDataKind === SensorKind.COLOR) {
} else if (sensorDataKind === SensorKind.DIGITAL || sensorDataKind === SensorKind.COLOR) {
const value1 = new Buffer(value.slice(0, 2)).readInt16LE();
const value2 = new Buffer(value.slice(2, 4)).readInt16LE();
const value3 = new Buffer(value.slice(4, 6)).readInt16LE();
Expand All @@ -361,8 +356,8 @@ class Neo extends BaseModule {
*/
parseResponsePdu(pdu) {
return {
blockId: pdu[IDX_PDU_CODE + 1],
result: pdu[IDX_PDU_CODE + 2],
blockId: pdu[IDX_ACK_NUM],
result: pdu[IDX_ACK_NUM + 1],
};
}

Expand Down
Loading

0 comments on commit bb34332

Please sign in to comment.