Hi,
I ordered a Espruino but while I wait I thought I'd try and get it working on a Hy Mini 2.4" LCD board I got from ebay. I have some WS2812 LEDs arranged in a panel so I am trying Project 2.
I couldn't get the serial loader to work - it went into the STM boot ROM but I couldn't get it to unprotect so I used my Black Magic Probe like so..
I had to apply the following diff to get the demo code working..
--- touchdemo.js.orig 2014-08-19 13:48:25.000000000 +0930
+++ touchdemo.js 2014-08-19 13:42:14.000000000 +0930
@@ -40,10 +40,11 @@
// Touchscreen handler
function touchFunc() {
if (!digitalRead(B6)) { // touch down
- var d = SPI1.send([0x90,0,0xD0,0],A4);
+ var d = SPI1.send([0x90,0,0xD0,0, 0],B7);
var pos = {x:(d[1]*256+d[2])*LCD.getWidth()/0x8000,
y:(d[3]*256+d[4])*LCD.getHeight()/0x8000};
- touchCallback(pos.x, pos.y);
+ touchCallback(pos.x, LCD.getHeight() - pos.y);
+ console.log(pos.x, pos.y, d, LCD.getWidth(), LCD.getHeight());
lastPos = pos;
} else lastPos = null;
}
To break it down..
1- Send 5 bytes so we read 5 bytes
2- Use B7 for chip select
3- Invert y position
I suspect 2 & 3 are only useful for this board, but number 1 seems like a bug in the original code - without it you only get 4 bytes so the Y coordinates are always NaN.
I haven't connected my LEDs yet, but soon :)
PS thanks for the Espruino, I am having good fun with it so far :)
Update: LEDs work, however I needed to change the baud rate in the example to 3200000 (like in the WS2811 example)
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi,
I ordered a Espruino but while I wait I thought I'd try and get it working on a Hy Mini 2.4" LCD board I got from ebay. I have some WS2812 LEDs arranged in a panel so I am trying Project 2.
I couldn't get the serial loader to work - it went into the STM boot ROM but I couldn't get it to unprotect so I used my Black Magic Probe like so..
I had to apply the following diff to get the demo code working..
To break it down..
1- Send 5 bytes so we read 5 bytes
2- Use B7 for chip select
3- Invert y position
I suspect 2 & 3 are only useful for this board, but number 1 seems like a bug in the original code - without it you only get 4 bytes so the Y coordinates are always NaN.
I haven't connected my LEDs yet, but soon :)
PS thanks for the Espruino, I am having good fun with it so far :)
Update: LEDs work, however I needed to change the baud rate in the example to 3200000 (like in the WS2811 example)