Most recent activity
-
Thanks again.
In fact I Added a"SoftwareSerial" TX function so that I can control several devices with one espruino . And it works amazingly well !function softwareSerialTX(pin, arr) { // 9600, 8N1 var baud = 1000/9600; let i, j, len; let binArr = []; len = arr.length; for (i = 0; i < len; i++) { binArr.push(0); for(j = 1; j < 256; j *= 2) { binArr.push((arr[i] & j) ? 1 : 0); } binArr.push(1); } binArr.push(0); let pulseArr = []; let start = binArr[0]; let v = start; let cnt = 1; len = binArr.length; for (i = 1; i < len; i++) { if (binArr[i] == v) { cnt++; } else { v = binArr[i]; pulseArr.push(cnt*baud); cnt = 1; } } if (cnt) { pulseArr.push(cnt*baud); } //console.log(arr); //console.log(binArr); //console.log(pin); //console.log(start); //console.log(pulseArr); digitalPulse(pin, start, pulseArr); }
-
-
I work in an Escape Game center