Skip to content

Commit

Permalink
Merge pull request #629 from entrylabs/develop-hw
Browse files Browse the repository at this point in the history
1.9.41 버전업
  • Loading branch information
Tnks2U authored Apr 20, 2023
2 parents 1d3a57f + 250ae52 commit 1c4eaf6
Show file tree
Hide file tree
Showing 12 changed files with 893 additions and 209 deletions.
Binary file modified app/firmwares/0uboard.bin
Binary file not shown.
Binary file modified app/firmwares/examples/iCOBOT_Entry/iCOBOT_firmwares_Use_KUP.zip
Binary file not shown.
48 changes: 47 additions & 1 deletion app/modules/0uboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ function Module() {
OLED: 241,
COM: 242,
NEOPIXEL: 243,
ULTRASONIC_COUNTER: 244
ULTRASONIC_COUNTER: 244,
DOTMATRIX: 245
}

this.actionTypes = {
Expand Down Expand Up @@ -332,6 +333,10 @@ Module.prototype.originParsing = function(data) {
self.sensorData.NEOPIXEL = value;
break;
}
case self.sensorTypes.DOTMATRIX: {
self.sensorData.DOTMATRIX = value;
break;
}
default: {
break;
}
Expand Down Expand Up @@ -529,6 +534,47 @@ Module.prototype.makeOutputBuffer = function(device, port, data) {
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]);

} else if (mode[0] == 3) {
buffer = new Buffer([255, 85, 10, sensorIdx, this.actionTypes.SET, device, 0]);
buffer = Buffer.concat([buffer, mode, index, red, green, blue, brig, dummy]);
} 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 green = new Buffer(1);
var blue = new Buffer(1);
var brig = new Buffer(1);

//var msgLength = data.length + 3;
mode[0] = data.mode; //네오픽셀 모드
index[0] = data.index; //네오픽셀 인덱스
value[0] = data.value; //갯수
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 Down
Loading

0 comments on commit 1c4eaf6

Please sign in to comment.