-
you flashed a hex file intended for a different board. The Rock is an nrf52840, which has more SRAM, flash and thus different addresses for DFU entry points, etc. So your board is in an unknown state, you'll need a full build of Magic3 with bootloader and soft device as a .hex file. Are you set up to do your own builds?
BTW: the Rock is not an officially supported Espruino board, you won't find any firmware for it here.
-
-
with a combination of online meeting tools / screen sharing, and the Web IDE relay, you can probably still teach them remotely?
-
A survey would indeed help shape JS3 into what most current users would like to see. And having the older alternatives is good for those who want the specialty items (like the barometer, or full color LCD). It depends on what Bangle's intended use really is.. a smart watch for hackers, or a hackable smart watch (they sound similar, but they're different!)
Myself, I am into the visual, and would enjoy the screen to be physically larger, hopefully without making the case TOO much larger. That would help touch screen behaviour as well. With more pixels (240x240 or greater) one can forgive the lack of colors (as anti-aliasing would be less necessary). I found the 64 color screen on the DK08 to be fantastic, if a tad too small and (sadly) low contrast (watches must be visible INDOORS on cloudy, dark Canadian "days"!)
That said, I also want to thank Gordon (and team!) for the fantastic work they've done and continue to do. I will certainly be a Kickstarter when the BJ3 is ready.
-
https://drive.google.com/file/d/1hldJC7VxSTJEAsg58bTm_5uf5vYUMxqG/view?usp=drivesdk
Up at the top under some foam, you'll see the 4 pins. from left to right: IO, CLK, 3.3, GND. Good to test them first though. If you leave the battery connected, you don't need to use the 3.3v. -
https://drive.google.com/file/d/1XsxoQC_5yIpBad0jxVS1WACeJpYWmc6P/view?usp=sharing
sorry should have warned you about the fake screws....
-
-
That's some nice work there, thank you for that! I have a hopefully easy Q. I am simply trying to identify the display that I have, a round 1.3" (probably a GC9A01) but I don't think I've got the read part of spi correct. I'm trying to ure spi.send:
let c = new Uint8Array([4,0,0,0]); JSON.stringify(SPI1.send(c,CS));
assuming SPI1 and CS are initialized correctly, should that code return the manufacturer information (command is 0x4, returns 4 bytes)?
I've tried it on a known GC9A01 and it doesn't work. Bad syntax? Do I need to lower DC? any help appreciated! -
-
-
Just for any who are interested... it does work! Of course, that's what it's intended for but I'm always concerned I'll fry something.
And for anyone searching, the W5500 Lite module (shown above) has different pin arrangements than the Wiznet board, so it's a little different than the Espruino doc but easy enough to follow. For the Espruino original, connect:
W5500 Lite Espruino J2 G GND J2 V 3.3 J2 MI B4 J1 MO B5 J1 SCK B3 J1 CS B2
Thanks to the Espruino team for making all those modules (ethernet, SD reader). Makes it so easy to get started!
-
Robust answer, thank you! All the pins fit fine in the prototype area, just wanted to make sure that I didn't accidentally put one in a hole tied to some distant pin! I've seen your images, really clever! But in the pictures above, I just have a handful of (standard) pins and I should only have to solder wire to about six of them. I guess there's only one way to prove it out... ;-)
-
-
https://www.aliexpress.com/item/1005002580402657.html?spm=a2g0o.9042311.0.0.27424c4djbKa9K
I also got the 44mm version and put that on my B2, but it's too big. 42 should be just right.
-
Maybe 'sweeping' was a poor choice... just a second hand would do. (Perhaps an 52840 could handle the former?...) what I've noticed is that the YFit firmware (for the SN80-Y) has a few watch faces with a second hand that updates pretty darn well -- likely uses an optimized algorithm to determine what part of the screen to update.
-
Fantastic job on the faces! Agreed that the display is not the speediest and a reminder to anyone wanting more speed to look into @fanoush's work for the P8 to have a buffered solution (with fewer colours perhaps, but capable of refreshing a sweeping second hand).
And thank you for pushing the driver forward.. it was just to get it off the ground and I haven't put more time into it since. Glad you freed up the memory (BTW: what are you using to profile the driver? I'm really not well versed in optimization, and I really need to be!) and cleaned up those timeouts. I think I'll just grab your baseline from here..
-
It really is a nice screen isn't it? and yes, much bigger looking than its spec. I just bought another SN80 recently, with DaFit firmware from AE, and just ran through the full process:
- Used DaFlasher to upload DaFitBootloader23Hacked.bin
- Used nrfConnect to upload FitBootloaderDFU2.0.1.zip
- Used nrfConnect to upload fanoush's p8-sdk11-to-sdk12.zip
- Used nrfConnect to upload jeffmer's image (github.com/jeffmer/WatchApps/firmware) espruino_2v11.1.5.4_SN80.zip
I used my own driver set for now, but all works perfectly. Nice work, @jeffmer!
A caution for anyone wanting to get an SN80 though.. my "new" one has a slightly misaligned LCD ( a vertical line from 12:00 to 6:00 is tilted a few degrees). Nothing tragic, but unfortunate as analog watches won't align to the tick marks on the bezel! Could be selling off QA rejections?
- Used DaFlasher to upload DaFitBootloader23Hacked.bin
-
That's great! I actually am running with my own driver for the moment... not as good, but for setPixel, I just set the color and go.. I don't buffer even the one line; so it's slower but I got it to work. I tried taking out double buffering but it didn't work for me... but I'll try your version for sure.
As for the button, I did get it to work.. According to atc1441's notes, btn1 is D9, and that works as long as you pull D17 high. I'm sure there's a less hacky way, but I defined two buttons, the second one being D17, and pull it high:
'BTN1' : { 'pin' : 'D9'} , 'BTN2' : { 'pin' : 'D17', 'pinstate' : 'IN_PULLUP'} ,
-
-
Pure JS:
/* Copyright (c) 2020 Akos Lukacs, based on code by Gordon Williams and https://github.com/Bodmer/TFT_eSPI. See the file LICENSE for copying permission. */ /* Module for the ST7789 135x240 LCD controller Just: */ var spi = new SPI(); spi.setup({sck:D2,mosi:D3,mode:0}); //spi.send([0xab],D5); const LCD_WIDTH = 240; const LCD_HEIGHT = 240; const COLSTART = 0; const ROWSTART = 0; function init(spi, dc, ce, rst, callback) { function cmd(c, d) { dc.reset(); spi.write(c, ce); if (d !== undefined) { dc.set(); spi.write(d, ce); } } if (rst) { digitalPulse(rst, 0, 10); } else { cmd(0x01); //Software reset } /* SN80 specific */ const ST7789_INIT_CODE = [ [0xFE], [0xEF], [0xEB,0x14], [0x84,0x40], [0x85,0xF1], [0x86,0x98], [0x87,0x28], [0x88,0xA], [0x8A,0], [0x8B,0x80], [0x8C,1], [0x8D,0], [0x8E,0xDF], [0x8F,82], [0xB6,0x20], [0x36,0x48], [0x3A,5], [0x90,[8,8,8,8]], [0xBD,6], [0xA6,0x74], [0xBF,0x1C], [0xA7,0x45], [0xA9,0xBB], [0xB8,0x63], [0xBC,0], [0xFF,[0x60,1,4]], [0xC3,0x17], [0xC4,0x17], [0xC9,0x25], [0xBE,0x11], [0xE1,[0x10,0xE]], [0xDF,[0x21,0x10,2]], [0xF0,[0x45,9,8,8,0x26,0x2A]], [0xF1,[0x43,0x70,0x72,0x36,0x37,0x6F]], [0xF2,[0x45,9,8,8,0x26,0x2A]], [0xF3,[0x43,0x70,0x72,0x36,0x37,0x6F]], [0xED,[0x1B,0xB]], [0xAC,0x47], [0xAE,0x77], [0xCB,2], [0xCD,0x63], [0x70,[7,9,4,0xE,0xF,9,7,8,3]], [0xE8,0x34], [0x62,[0x18,0xD,0x71,0xED,0x70,0x70,0x18,0x0F,0x71,0xEF,0x70,0x70]], [0x63,[0x18,0x11,0x71,0xF1,0x70,0x70,0x18,0x13,0x71,0xF3,0x70,0x70]], [0x64,[0x28,0x29,1,0xF1,0,7,0xF1]], [0x66,[0x3C,0,0xCD,0x67,0x45,0x45,0x10,0,0,0]], [0x67,[0,0x3C,0,0,0,1,0x54,0x10,0x32,0x98]], [0x74,[0x10,0x80,0x80,0,0,0x4E,0]], [0x35,0], [0x21], ]; setTimeout(function () { //cmd(0x11); //Exit Sleep setTimeout(function () { ST7789_INIT_CODE.forEach(function (e) { cmd(e[0], e[1]); }); setTimeout(()=>{ //delay_0(120); cmd(0x11); }, 120); setTimeout(()=>{ //delay_0(120); cmd(0x29);}, 240); setTimeout(()=>{ //delay_0(120); cmd(0x2A,[0,0,0,0xEF]); cmd(0x2B,[0,0,0,0xEF]); cmd(0x2C);}, 360); if (callback) setTimeout(callback, 500); }, 20); }, 120); /**/ } let connect = function (spi, dc, ce, rst, callback) { var g = Graphics.createCallback(LCD_WIDTH, LCD_HEIGHT, 16, { setPixel: function (x, y, c) { ce.reset(); spi.write(0x2A, dc); spi.write((COLSTART + x) >> 8, COLSTART + x, (COLSTART + x) >> 8, COLSTART + x); spi.write(0x2B, dc); spi.write((ROWSTART + y) >> 8, ROWSTART + y, (ROWSTART + y) >> 8, (ROWSTART + y)); spi.write(0x2C, dc); spi.write(c >> 8, c); ce.set(); }, fillRect: function (x1, y1, x2, y2, c) { ce.reset(); spi.write(0x2A, dc); spi.write((COLSTART + x1) >> 8, COLSTART + x1, (COLSTART + x2) >> 8, COLSTART + x2); spi.write(0x2B, dc); spi.write((ROWSTART + y1) >> 8, ROWSTART + y1, (ROWSTART + y2) >> 8, (ROWSTART + y2)); spi.write(0x2C, dc); spi.write({ data: String.fromCharCode(c >> 8, c), count: (x2 - x1 + 1) * (y2 - y1 + 1) }); ce.set(); } }); init(spi, dc, ce, rst, callback); return g; }; var img = { width : 206, height : 96, bpp : 2, transparent : -1, palette : new Uint16Array([0,65535,6339,61277]), buffer : require("heatshrink").decompress(atob("AE8LqoAD8AyrgXVGQdWM1ktMwlwM2NXwBmxvBm/M34ASgYyEM1s1GYlYGVcLGQlVM1m1GQlcM2XgM2NeM35m/ACUJMwtgGdeVGQlWGVcNM2MC6oyEq+AGdUlMwt4GVUDGQtV4Azq2ouBr/1AYNcGVULZAP+1W/aQPgEzuoBZUC6tf1QFB1X1q+ABgWqAAIGDACUJXJQyBvwlDgQzB3AFBh////+Ga2cZhdeEggzBrqbCagNVvxmhlqSEAAMK6oICg6ZB394M0ELGQwzCrwEBF4WtNoRmdZgIiHhdVuBmBH4W3M0G1RJEtqxmEgXYMz8tR4QAE0A9DMwctdRRmUgXXZg0uBQhzD7xmf2rMGhYHBhpxBMwcJbw5mXhtcBA24HwVwMwmeMzyZIl4HBBYRmDhrNfmtgHYyPCTQRmCgXcMz0LEwKZIbIRmDOARmdTJBqDqxmDhbTBMzsteQYACgaZCBgRmChXeGShmJLISZJOYV61Wq+54DhWu1EC0ABBBoIWD1XqwEqMwkq/+oBwU1LwaZGSgNYgv///1vQyD/tf9G+CgOv//6DYf1/+C+BmDlfVCoKRCrxuGHQm14FfGYP9vwOC746B9fggV9v/9XIUvv//72nMwcLv/r+onCEoKZKhde06LB1W9EwW31Eq+5mBkv+BgIjBhd+0Grv1wMwUC72gCoK3BRgKZGYQanBv4uCIwImBloCBNIJmBr2AgQ4BFIIbBlt3Mwe3BAMK7wfCFYiZGgVVq4ODDQMLHQRzBMwIVBgYJBm4TClpmDJAQVBBAMJK4YAClAFEktVBwcC/BZBAwQhBgQNCk+AhIpCgXXMwQODIAeXMwoyFMwwsBloGDG4IvBCQPYA4RdEMwO3EQYPBhpmFhegMxUA3xQEhZmBFAI/BwDoEm5mChPq1QAB1rUB65mF3RmLgdgEII5DMwJWDVAIZD+BmCy//AAR0BZo0CaYpmGmw0BMx8vMwdVAAbbBZow0B1BmLmwSDnxmGIwZmEzyZC1QnBhdYZouA3/oMy8nMxBhBAAm1Mws4l2qBAUDq/3ZreeGQsLrgGEgeCIQm19RmE3yNEZphEBMwIQBGYs1A4s4DAhABg4GDhvgRohmGgHeDIY9BMwO2GQsDrwGFZoIlDU4LtE/ECEwctMwzEEy5mCgYcDlzzCMw0C3wzCht4Mwm3KoIdChZNBMws3CYUtMwZEBCoVgCQPXEgZmCgG4D4QMBJIetDQOnAQMC6pmGOYcru5mCgCKCBgZZBMwo/BCQJzCMwevCQJJD2/+Mw0LvwCB75mDgQIBgX3EAW1TQkDxWA3jaEr////9SwfX9X19ZmGAQN/1/f05mDhdf1f3FwQmCMwku1Y/CyvAgtVAAP6B4Ur6tV/G+Mw0A3tVr+iMwcAl4cB9AcClqaEgeC34/CBYWqAAQQDlf//UKMwLxDVYf/0A9BhQIC1f/GQcAW4RmDgWoDwVXOQgATgakCABELTQkDHAjZFACk2BhaaFnAKJACCACLIJNLgXVBoZmETK0JEAfeCJYoBFwcoHolgGam+AYUvXQiaIZwjMEMysCvRYCWhu1Bw8tqqyLABMvvWq1aZMSAX4DQ1VJZoAI3v///fTJh1BqvoA4krqpLNKhO9qtX0ASNltXSIkr6trJZoAJlf+DJ7FB/QSBgWvTC4AU2tV/2q1X9qteGVUDqtVr//+oEBTC4ATmouBAAdYGVUCGQtXM1ctGYtwGVUA6oyEqwyrhJmFsAzryoyErwyrhZmF8Azr2pm/M1dcM2WAM2NYGVcDGQlXM1k1GYl4GVcC6pmxlpm/M1dwM2QyrMw1gGdm1GQdeBQg=")) }; /**/ var g = connect(spi, D18, D25, D26, function() { digitalWrite(D23,0); g.clear(); //g.setRotation(1); // g.drawString("Hello",0,0); //g.setFontVector(20); g.setColor(0.5,1,1); g.setFont("6x8",1); g.setFontAlign(0,0); g.drawString("Espruino",120,20); g.setFontVector(12); g.drawString("Espruino",120,40); g.drawCircle(60,40,20); g.fillCircle(180,40,20); g.setColor(1,0,1); g.drawRect(40,75,80,100); g.fillRect(160,75,200,100); g.setColor(1,1,0); g.drawPoly([70,130,80,110,90,130,100,110,110,130, 110,140,70,140], true); g.fillPoly([130,130,140,110,150,130,160,110,170,130, 170,140,130,140], true); g.setColor(0.5,0.5,1); for(let x = 90; x < 120; x+=5) { g.drawLine(x, 60, x, 90); } for(let y = 60; y < 90; y+=5) { g.drawLine(125, y, 155, y); } g.drawImage(img,20,144); });
lcd_spi_unbuf version:
const logD = console.log; let batV=() => { return 7.1 * analogRead(D31); }; //var spi = new SPI(); SPI1.setup({sck:D2,mosi:D3,baud:8000000,mode:0}); //spi.send([0xab],D5); const LCD_WIDTH = 240; const LCD_HEIGHT = 240; const COLSTART = 0; const ROWSTART = 0; const INVERSE = 0; /* SN80 specific */ const ST7789_INIT_CODE = [ [0xFE], [0xEF], [0xEB,0x14], [0x84,0x40], [0x85,0xF1], [0x86,0x98], [0x87,0x28], [0x88,0xA], [0x8A,0], [0x8B,0x80], [0x8C,1], [0x8D,0], [0x8E,0xDF], [0x8F,82], [0xB6,0x20], [0x36,0x48], [0x3A,5], [0x90,[8,8,8,8]], [0xBD,6], [0xA6,0x74], [0xBF,0x1C], [0xA7,0x45], [0xA9,0xBB], [0xB8,0x63], [0xBC,0], [0xFF,[0x60,1,4]], [0xC3,0x17], [0xC4,0x17], [0xC9,0x25], [0xBE,0x11], [0xE1,[0x10,0xE]], [0xDF,[0x21,0x10,2]], [0xF0,[0x45,9,8,8,0x26,0x2A]], [0xF1,[0x43,0x70,0x72,0x36,0x37,0x6F]], [0xF2,[0x45,9,8,8,0x26,0x2A]], [0xF3,[0x43,0x70,0x72,0x36,0x37,0x6F]], [0xED,[0x1B,0xB]], [0xAC,0x47], [0xAE,0x77], [0xCB,2], [0xCD,0x63], [0x70,[7,9,4,0xE,0xF,9,7,8,3]], [0xE8,0x34], [0x62,[0x18,0xD,0x71,0xED,0x70,0x70,0x18,0x0F,0x71,0xEF,0x70,0x70]], [0x63,[0x18,0x11,0x71,0xF1,0x70,0x70,0x18,0x13,0x71,0xF3,0x70,0x70]], [0x64,[0x28,0x29,1,0xF1,0,7,0xF1]], [0x66,[0x3C,0,0xCD,0x67,0x45,0x45,0x10,0,0,0]], [0x67,[0,0x3C,0,0,0,1,0x54,0x10,0x32,0x98]], [0x74,[0x10,0x80,0x80,0,0,0x4E,0]], [0x35,0], [0x21], [0x29], ]; function ST7789() { var LCD_WIDTH = 240; var LCD_HEIGHT = 240; var XOFF = 0; var YOFF = 0; var INVERSE = 1; var cmd = lcd_spi_unbuf.command; function dispinit(spi, dc, ce, rst, fn) { if (rst) { digitalPulse(rst,0,10); } else { cmd(0x01); //ST7789_SWRESET: Software reset, 0 args, w/delay: 150 ms delay } setTimeout(function() { cmd(0x11); //SLPOUT setTimeout(function () { ST7789_INIT_CODE.forEach(function (e) { cmd(e[0], e[1]); }); if (fn) setTimeout(fn, 500); }, 20); }, 120); return cmd; } function connect(options , callback) { var spi=options.spi, dc=options.dc, ce=options.cs, rst=options.rst; var g = lcd_spi_unbuf.connect(options.spi, { dc: options.dc, cs: options.cs, height: LCD_HEIGHT, width: LCD_WIDTH, colstart: XOFF, rowstart: YOFF }); g.lcd_sleep = function(){cmd(0x10);cmd(0x28);}; g.lcd_wake = function(){cmd(0x29);cmd(0x11);}; dispinit(spi, dc, ce, rst); //g.cmd = cmd; return g; } //var spi = new SPI(); SPI1.setup({sck:D2, mosi:D3, baud: 8000000}); return connect({spi:SPI1, dc:D18, cs:D25, rst:D26}); } //screen brightness function function brightness(v) { v=v>7?1:v; digitalWrite([D23,D22,D14],7-v); } let g = ST7789(); brightness(7); var img = { width : 206, height : 96, bpp : 2, transparent : -1, palette : new Uint16Array([0,65535,6339,61277]), buffer : require("heatshrink").decompress(atob("AE8LqoAD8AyrgXVGQdWM1ktMwlwM2NXwBmxvBm/M34ASgYyEM1s1GYlYGVcLGQlVM1m1GQlcM2XgM2NeM35m/ACUJMwtgGdeVGQlWGVcNM2MC6oyEq+AGdUlMwt4GVUDGQtV4Azq2ouBr/1AYNcGVULZAP+1W/aQPgEzuoBZUC6tf1QFB1X1q+ABgWqAAIGDACUJXJQyBvwlDgQzB3AFBh////+Ga2cZhdeEggzBrqbCagNVvxmhlqSEAAMK6oICg6ZB394M0ELGQwzCrwEBF4WtNoRmdZgIiHhdVuBmBH4W3M0G1RJEtqxmEgXYMz8tR4QAE0A9DMwctdRRmUgXXZg0uBQhzD7xmf2rMGhYHBhpxBMwcJbw5mXhtcBA24HwVwMwmeMzyZIl4HBBYRmDhrNfmtgHYyPCTQRmCgXcMz0LEwKZIbIRmDOARmdTJBqDqxmDhbTBMzsteQYACgaZCBgRmChXeGShmJLISZJOYV61Wq+54DhWu1EC0ABBBoIWD1XqwEqMwkq/+oBwU1LwaZGSgNYgv///1vQyD/tf9G+CgOv//6DYf1/+C+BmDlfVCoKRCrxuGHQm14FfGYP9vwOC746B9fggV9v/9XIUvv//72nMwcLv/r+onCEoKZKhde06LB1W9EwW31Eq+5mBkv+BgIjBhd+0Grv1wMwUC72gCoK3BRgKZGYQanBv4uCIwImBloCBNIJmBr2AgQ4BFIIbBlt3Mwe3BAMK7wfCFYiZGgVVq4ODDQMLHQRzBMwIVBgYJBm4TClpmDJAQVBBAMJK4YAClAFEktVBwcC/BZBAwQhBgQNCk+AhIpCgXXMwQODIAeXMwoyFMwwsBloGDG4IvBCQPYA4RdEMwO3EQYPBhpmFhegMxUA3xQEhZmBFAI/BwDoEm5mChPq1QAB1rUB65mF3RmLgdgEII5DMwJWDVAIZD+BmCy//AAR0BZo0CaYpmGmw0BMx8vMwdVAAbbBZow0B1BmLmwSDnxmGIwZmEzyZC1QnBhdYZouA3/oMy8nMxBhBAAm1Mws4l2qBAUDq/3ZreeGQsLrgGEgeCIQm19RmE3yNEZphEBMwIQBGYs1A4s4DAhABg4GDhvgRohmGgHeDIY9BMwO2GQsDrwGFZoIlDU4LtE/ECEwctMwzEEy5mCgYcDlzzCMw0C3wzCht4Mwm3KoIdChZNBMws3CYUtMwZEBCoVgCQPXEgZmCgG4D4QMBJIetDQOnAQMC6pmGOYcru5mCgCKCBgZZBMwo/BCQJzCMwevCQJJD2/+Mw0LvwCB75mDgQIBgX3EAW1TQkDxWA3jaEr////9SwfX9X19ZmGAQN/1/f05mDhdf1f3FwQmCMwku1Y/CyvAgtVAAP6B4Ur6tV/G+Mw0A3tVr+iMwcAl4cB9AcClqaEgeC34/CBYWqAAQQDlf//UKMwLxDVYf/0A9BhQIC1f/GQcAW4RmDgWoDwVXOQgATgakCABELTQkDHAjZFACk2BhaaFnAKJACCACLIJNLgXVBoZmETK0JEAfeCJYoBFwcoHolgGam+AYUvXQiaIZwjMEMysCvRYCWhu1Bw8tqqyLABMvvWq1aZMSAX4DQ1VJZoAI3v///fTJh1BqvoA4krqpLNKhO9qtX0ASNltXSIkr6trJZoAJlf+DJ7FB/QSBgWvTC4AU2tV/2q1X9qteGVUDqtVr//+oEBTC4ATmouBAAdYGVUCGQtXM1ctGYtwGVUA6oyEqwyrhJmFsAzryoyErwyrhZmF8Azr2pm/M1dcM2WAM2NYGVcDGQlXM1k1GYl4GVcC6pmxlpm/M1dwM2QyrMw1gGdm1GQdeBQg=")) }; /**/ setTimeout(()=>{ g.clear(); g.setColor(0.5,1,1); g.setFont("6x8",1); g.setFontAlign(0,0); g.drawString("Espruino",120,20); g.setFontVector(12); g.drawString("Espruino",120,40); g.drawCircle(60,40,20); g.fillCircle(180,40,20); g.setColor(1,0,1); g.drawRect(40,75,80,100); g.fillRect(160,75,200,100); g.setColor(1,1,0); g.drawPoly([70,130,80,110,90,130,100,110,110,130, 110,140,70,140], true); g.fillPoly([130,130,140,110,150,130,160,110,170,130, 170,140,130,140], true); g.setColor(0.5,0.5,1); for(let x = 90; x < 120; x+=5) { g.drawLine(x, 60, x, 90); } for(let y = 60; y < 90; y+=5) { g.drawLine(125, y, 155, y); } g.drawImage(img,20,144); },500);
-
@jeffmer Thanks, that was it of course... however I'm running into some more weirdness now.. I have a test pattern I'm writing to screen (bitmap font, vector font, lines, filled/unfilled shapes and an image. When I use the JS-only method to drive the display, everything displays, albeit very slowly.
pure JS version
When I use lcd_spi_unbuf (with proper command), filled shapes and drawRect work..every other horizontal line seems to work, and drawCircle/drawPoly do NOT seem to work at all.
lcd_spi_unbuf version
I must be missing an initialization of something.? -
-
-
Well I'm looking forward to that! Glad to hear it won't be secret for long...
Another Q... this SN80 is an interesting beast; it seems to be nearly identical to the P8s in the wild (same pinouts, samed shared SPI for display / ext flash). I'm using @jeffmer 's code for the shared SPI (basically his P8 build untouched except for the name), and I'm getting an SPI error during display initialization.
Uncaught InternalError: Timeout on SPI0-lock at line 19 col 28 spi.write(c, ce); ^ in function "cmd" called from line 32 col 9 cmd(0x11); //SLPOUT ^ in function called from system >
When I was running the firmware without shared SPI (no ext flash) I didn't get this. I assumed that this code would be safe regardless if it's shared or not (it errs on the side of caution by pausing the other device). My impression is that this is saying "SPI is in use or not ready". Am i interpreting that correctly? (BTW: the external flash works, I'm able to save files and read them back.. but this started as soon as I began working with both display AND spi flash).
Any insights or thoughts welcome...
you'll need a buffer for each moving part (which could eat a lot of memory on Bangle1), set timeouts to loop through each "frame", calculating coordinates to copy from buffer to the lcd, and you may see some lag & jitter as you're asking the little cpu to do a lot of work (assuming Bangle1 again).
Bangle2 is more capable of this and could probably handle the ones you've shared fine. which watch are you targeting?