-
-
-
-
Does it use SPI1 or SPI3? (when connected to the Espruino board per instructions http://www.espruino.com/CC3000 )
This matters, at least as I understand things:
If the SD card reader is in use, that is on SPI2.
SPI1 can be on either B3/B4/B5 or A5,A6,A7.
SPI3 can only be on B3/B4/B5.Thus, if we want to have both the SD card reader AND WiFi, if the CC3000 is on SPI1, there are zero available SPI interface, while if the CC3000 is on SPI3, we can still use SPI1 on pins A5-7.
-
Is there any way to change the text size, or zoom in on the Espruino IDE?
I do much of my development on a 13.3 inch laptop with a retina-class screen (Asus UX301LA-XH72T). For most applications, I increase the font size or set zoom to 120 or 130% so that I can comfortably read the text on that beautiful super-sharp screen.
Is it possible to do this in the Espruino IDE?
-
Can anyone explain what's going on here?
scancolor=0
var temp=255
=255
print(temp.toString(16));
FF
=undefined
var temp=255*Math.pow(256,scancolor);
=255
print(temp.toString(16));
255
=undefinedWhy is the argument to toString() being ignored in the second case?
Other JS interpreters don't seem to have this behavior. -
I got the 1600000 from the video, http://www.youtube.com/watch?v=RBHP4xDCRk4
that was shown during the kickstarter . I wish I'd found the tutorial when I was doing this (so I could have copy-pasted the code), but I'd have still thought I needed 1600000, since the video was using the same arrays I'm using, while the tutorial that stated 3200000 used the WS2811's not WS2812's. -
Well, this thread was originally going to be a question - but I seem to have figured out how to make it work, but since I can't delete the thread, I might as well post what worked.
I got my Kickstarter Espruinos today - my first microcontrolers , and decided trying to use them with the RGB-123 LED arrays that I also got on kickstarter. I used the 8x1 model, so I didn't have to hook up an external powersupply (see my question below) , and could run the whole thing off USB. Wired it up as was done in the example, using B15/SPI2.
Copying the example from the video did not work - the first call to the flip() function turned all the LEDs on white at full brightness. All subsequent calls did the same. The baud rate given appears to be the problem - doubling it fixed it.
I had success with this block of code:
Note that all colors are BRG, not RGB!
SPI2.setup({baud:3200000, mosi:B15}); var leds= Graphics.createArrayBuffer(8,1,24); leds.flip = function () { SPI2.send4bit(leds.buffer, 0b0001, 0b0011); } ; //at this point, you can do things like //leds.setColor(B,R,G) to set foreground color and the draw* methods to draw shapes. leds.setColor(0.065,0.65,0); leds.drawLine(2,0,5,0); leds.setPixel(0,0,0xff2222); leds.setPixel(1,0,0xff2222); leds.setPixel(6,0,0xff2222); leds.setPixel(7,0,0xff2222); leds.flip(); //Curiously, Graphics.setPixel(x,y) won't set that pixel to foreground color. //Likewise, there aren't functions to draw shapes in a specified color - only the one set by setColor() //Set colors with a single function call: leds.lightPixel = function (x,y,col) {this.setPixel(x,y,col); this.flip();}; leds.lightPixel(0,0,0x0011aa); leds.lightPixel(7,0,0x0011aa);
At this point, I have a question about working with the Espruino, since I've never worked with microcontrolers before - can I safely have it connected to an external powersupply while it's connected to USB?
The DHT11 (and higher-spec'ed DHT22 - I've got one on it's way from china to try out) are widely available temperature+relative humidity sensors that communicate with the controller via an (apparently non-standard) single wire protocol, as (inaccurately) described in the datasheet: http://www.micro4you.com/files/sensor/DHT11.pdf The most appealing feature of these sensors is that they are cheaper than dirt (like, $1.50 a pop, shipped cheap) - and their accuracy is good enough for lots of cases.
After some experimentation, I was able to get correct date out of the DHT11 with the code provided below. I'm sure this code is pretty far from ideal, and I'd like to clean it up - if anyone has any advice on that, I'd love to hear it. I know the fact that I'm doing setTimeout() with a string to be evaluated is bad, particularly since it makes it awkward to select the pin to use - but I can't figure out how to make it work otherwise. I figure I should also put all of those global variables inside of the dht object. Also - is there a better way than making an array of bits and accessing them like I do?
I found a few caveats when interfacing with these:
usage: dht.read(function());
ex: dht.read(function(a){print("Data: "+a.rh.toString()+" %RH "+a.temp.toString()+" C");});
Get data from the DHT11, and then call the supplied function when the data is available. Function is called with one argument, an object with properties 'temp' and 'rh'.