-
-
-
I had one around, (exactly this: https://www.sparkfun.com/products/12574) and tried interfacing. It's been pretty easy, I just connected pin 11 to 3.3v, pin 12 to GND, pin 13 to A2 and pin 14 to A3 and that was it.
s = Serial2; s.setup(115200, { parity:'none', bytesize:8, stopbits:1 }); s.onData(function(d) { var data = d.data; print(d.data); });
With this code I can echo stuff written to the corresponding serial port on the pc.
-
-
-
-
-
Hi,
http://www.indiegogo.com/projects/kinoma-create
opinions?
Mine are: It certainly is cool running javascript on microcontrollers, we already know from experience. Package looks nice, programming environment is to be seen, and it's a bit too expensive for my own taste (I actually find espruino a bit too expensive already, if it costed 5$ I could do different things with it)... anyway, it's ARM based too, so some form of cross usefulness could be exploited maybe? (I mean, if their community writes something it could be ported here).Bye
-
-
That's what I'm working on. I've got the speakJet, a bunch of encoders, a nokia lcd, and a 1.8w amp from sparkfun. The espruino is sending serial commands to the chip and it's speaking fine - just a matter of connecting A9 to serial in, they both agree on 9600/8N1 by default. Now I'm going to start thinking about how to make it into a useful musical instrument. I'll try and use that capacitive strip I bothered you about sometime ago (still had no time to dwelve into pokes); I believe I will also implement midi, I've seen the 6n138s is quite popular there. It's being rather fun so far!
-
-
Sorry for being sort of out of topic, I'm not advertising, I don't work for them, I just hope to be useful to somebody... I believe they did a typo:
(that's 0.99$ for a 320x240 rgb display, the version with CFL backlight is same price). Unfortunately they seem to ship only to english speaking countries, so I'm out of luck, otherwise I would have got 10 just for the sake of it, even without knowing how to interface them to anything!
I suggest you grab them if you can, sounds like a very good deal, doesn't it? -
-
Hi Gordon,
Yes I actually did a small heart pixel by pixel at some point.. but converting something existing sounds convenient too (altrough.. with that resolution.. I don't know..).
Also, thanks for the tip on buffer.set(), I didn't realize I could blit characters into it.. I will certainly find some use for that, like easily implementing fillRect for non-gray colors.So keep posted for the polished version as tutorial!
bye
-
I was in the situation described in the subject, and wired my 25 led strip as an array; I tried uploading an image but couldn't - use your fantasy, it's 5 one way and five the other and so on. I also installed a 10 μF capacitor in parallel with the strip +5v (I read it's a good idea to be sure your power supply doesn't fry the first led when being powered).
If you have a 3d printer you can probably do much better than me, but I don't... so I used duct tape to keep it in place!
Also, I did the error of assuming a cartesian coordinate system, so my 0,0 is bottom left - I could have chosen top left and made my life easier (actually, I believe the docs for Graphics don't say anything about coordinate system, maybe they should?). Anyway, I was able to use the Graphics class to write to my led strip; I was inspired by the Adafruit Neopixel library as well, but didn't really get that nice separation between the strip and the matrix part they have; So here's the code:function QuadStrip(width, height, spi) { this.spi = spi; this.spi.setup({baud:3200000}); var really_me = this; this.width = width; this.height = height; this.size = width * height; this.buffer = new Uint8Array(this.size * 3); this.flip = function() { this.spi.send4bit(this.buffer, 0b0001, 0b0011); }; this.flip(); this.setPixel = function(x, y, c) { var idx; // If you wired it from top left, then check for === 0; // I wired it from bottom left; if (y % 2 === 1) { idx = y * height + x; } else { idx = y * height + ((width - 1) - x); } idx = idx * 3; really_me.buffer[idx] = (c & 0xff0000) >>> 16; really_me.buffer[idx+1] = (c & 0x00ff00) >>> 8; really_me.buffer[idx+2] = c & 0x0000ff; }; // I only implemented fast clear because it's more common, because it // gets called on Graphic.clear, and because I'm lazy // If you need a proper fillRect you'll have to implement it. this.fillRect = function(x1, y1, x2, y2, c) { if (x1 === 0 && y1 === 0 && x2 === (really_me.width - 1) && y2 === (really_me.height - 1) && really_me.isGray(c)) { var lum = c & 0x0000ff; for (var i = 0; i < really_me.size * 3; i++) { really_me.buffer[i] = lum; } } else { print("Unimplemented.. sorry!"); } }; this.isGray = function(c) { var r = (c & 0xff0000) >>> 16; var g = (c & 0x00ff00) >>> 8; var b = c & 0x0000ff; return ((r == g) && (g == b)); }; }
and you can use it like that:
var strip = new QuadStrip(5,5, SPI1); var graphic = Graphics.createCallback(5,5,24, strip);
Which is not ideal, but you get an idea.. just a check with a bi-colored cross:
graphic.setColor(0x0000ff); graphic.drawLine(0,0,4,4); graphic.setColor(0x220000); graphic.drawLine(0,4,4,0); strip.flip();
Ah yes, you have to call flip() to actually send the thing via SPI.. on to something beefier: A tiny, unreadable, scrollable text that could be read from miles away (if it wasn't unreadable) because of display brigtness:
var pos = 0; var pix = -3; var text = "HELLO ESPRUINO!"; function showText() { if (pix > 4) { pix = -3; pos ++; } if (pos > text.length) pos = 0; graphic.clear(); graphic.drawString(text.charAt(pos), pix, 0); strip.flip(); pix++; } setInterval(showText, 50);
So there you go. Does anyone think that would be a good tutorial? if so I may polish it a bit and make it so, by having actual photos, and by fiddling with the code formatting (I can't get it to tab correctly), and also check if it works with other resolutions ( I only checked whith a 25 led strip, arranged as 5x5).
Bye!
-
-
-
Actually after having posted it came to my mind that I could google for "capacitance arduino" and actually found this: http://arduino.cc/en/Tutorial/CapacitanceMeter#.UxWz6vRdX2c
Which is not simple, but doable. I'll let you know if I make any progress.
Cheers! -
-
-
I'm running 33.0.1750.117 on OSX and after reinstalling the extension (I wanted to get back to original settings) I was having roughly the same issue (not exactly, but still layout was totally wrong and interface unusable); By trial and error (and lots of luck actually!), I issued
Espruino.Config.set('code','')
in the extension developer mode console, and after restarting it worked fine - Previously I had about 100 lines; Interestingly, reloading the same code and then restarting the extension was ok, so it's not just that it doesn't like that much code.
-
Hello,
First thing, I guess email notifications from the forum don't work.. I didn't receive any at least.
I just upgraded the firmware to 1.48 and now it works at 3200000 baud, and does not at twice that.
Just being curious: you say the STM32 gets it right to within 50%.. do you mean "randomly" or that it has some fixed baud rates at which it latches?
Also, could other interfaces be used to the same purpose?
Cheers! -
I was having white leds too, even more so by doing as the tutorial suggests (halving the baud rate); by doubling it I'm able to address all 25 of them, with just an occasional flickering.
By reading http://bleaklow.com/2012/12/02/driving_the_ws2811_at_800khz_with_a_16mhz_avr.html , I suspect the problem may be related to low/high speed mode, which I don't understand if it's related to the chip variant or if it's supposed to auto-sense that, and anyway it's mostly by luck that this setting actually works; If I had a logical analyzer I would be curious to actually see what is coming out of MOSI, I suspect it may work because the STM32 is putting some delay between each byte sent.
And no, personally I don't have those other array problems you mention.
Bye,
Luca -
Hello,
After some trial and error, which even lead to studying the exact timings the controllers wanted and trying send8bit with various bit patterns, I found out that just doubling your suggested clock rate works fine! That is on the kickstarted boards with the supplied led strip. So I use
SPI1.setup({baud:6400000 , mosi:A7}); ... SPI1.send4bit([0, 0, 255], 0b0001, 0b0011);
The original 3200000 baud rate suggested never works for me!
Cheers,
Luca
Yes please don't call the constructor for a new Date 'connect' - that wouldn't have any sense!