-
@Kim, thanks a lot, often problems are located between the ears :-)
-
-
-
-
-
After taking a lot of care on USB port, I accidently pushed the SD card a little bit in the wrong direction. Its not broken mechanically. Has anybody a simple testroutine to see it working (hopefully).
Already tested a simple require, which stores something on SD, and that works. But I'm not sure this is a serious test. -
As far as I understand, DS18B20 is a serial device and A1/A0 are not serial ports, they are PMW/ADC, at least on Espruino Board.
Anyway, on my Espruino I tested same with port B7, and its not working.
Search failes to find the sensor.
Upgraded to 1v46 did not help.
Downgraded to 1v43 (r1.3) and it works, at least search works and I get a device back.
But 1V43 seems to have problems somewhere around "this", get an error that EOF was found where } was expected (???)
So this is not a solution for the problem. -
My installation is:
STLinkDriver 1.04.00
STM32 ST-Link Utility 3.1
Windows Driver Package - STMicroelectronics USBDevice(12/05/2012 13.54.20.543)
All of this is installed using "start as admin"My main problem was the USB cable which was wired for power only.
Everything was installed on Windows 8, and is still running after updating to 8.1
-
-
-
-
-
- placing the board in an angle does not change anything.
- Adding a line
SPI1.setup({sck:A5, miso:A6, mosi:A7});
did not change anything. - On any call to read register I get back [0,0];
for(var i = 0;i < 63; i++){console.log(i,SPI1.send([i+128,0], E3));} - Adding a wait between each call did not change anything
BTW, testing same with SPI2 gives same result. Is there any way to recognize connected SPI devices ?
2ndBTW, dump returns this(and a lot of other lines)
SPI1.setup({sck:A5, miso:A6, mosi:A7});
pinMode(A6,input_pullup);
pinMode(B14,input_pullup);
digitalWrite(E3,1);
Where is B14 comin from ? - placing the board in an angle does not change anything.
-
Is there a way to read acceleromter on STM32F4Discovery ?
I tried the example on http://www.espruino.com/LIS302DL,
but it always returns 0 for accx and accy on my board.
Checked it with Espruino version 1.45 -
I'm also interested in this. Just seen an 25€ offer in ebay (Germany).
As soon as I get my Ultimate Kit, this board could be something like a host for all Espruinos, ...
http://www.ebay.de/itm/STM32F4-DISCOVERY-STM32F429-TFT-LCD-STM32-ARM-Cortex-M4-Development-Board-/161177600716Regards from Krefeld(sunny, 3 degrees)
Juergen -
Hello Andrey,
for me it works this way. Type of sensor can be recognized in device info of sensor
regards
Juergenfunction OneWireTemp(pin){ var me = this; me.ow = new OneWire(pin); me.device = me.ow.search()[0]; me.deviceType = me.device - ((me.device >> 8) << 8); me.readRegister = function(callback,n){ if(!n)n = 8; var reg = []; me.ow.reset();me.ow.select(me.device);me.ow.write(0x44,true); me.ow.reset();me.ow.select(me.device);me.ow.write(0xBE); for(var i = 0; i < n; i++){reg.push(me.ow.read());} return reg; }; me.getTemp = function(callback){ var t,reg = me.readRegister(2); t = reg[0] + (reg[1] << 8); if(t > 32767) t -= 65536; switch(me.deviceType){ case 40: t = t / 16; break;//ds18B20 case 16: t = t / 2; break;//ds18S20 } return t; }; }
-
Just checked on my STM32F4Discovery and it works fine with this:
var t = require("DS18B20").connect(D8);
console.log(t.getTemp());
BTW, V1.41 is an old version, did you test actual version(V1.44) form nightly build ?
https://espruino-nightly.noda.se/regards Jürgen
-
Prototyping works fine in Espruino like this:
function a(v){ this.a = v; this.inc = function() {this.a++;}; }
function b(v,x){ a.call(this,v); this.b = x; }
b.prototype = a;
b.prototype.constructor = b;
var t = new b(1,5); console.log(t.a,t.b);
t.inc(); console.log(t.a,t.b);I now would like to create something like OneWireDS18_20 using prototype and cannot get it working.
function myOneWire(pin){ OneWire.call(this,pin); }
myOneWire.prototype = OneWire;
myOneWire.prototype.constructor = myOneWire;
var myOW = new myOneWire(D8);
console.log(myOW.search()); -
-
I've had the problem in a big function and reduced to show the problem.
Simple example for the need could be to- have a blinker running
- need the status of the blinker somewhere else in your code
Right now I help my self using a get-function, instead of b.a
Any handling of a (line 5 and 6) should cause an error in my understanding.
In jsfiddle it does.
Before running this short example my board(32STMF4Discovery) was disconnected and "reset();" was sent in terminal window, before transfering the source above.
- have a blinker running
-
trying this, I would expect an errormessage for incrementing a.
In Espruino, a is incremented twice, and in log there is 1 3 5 ....21 23
But by typing console.log(b.a) thje answer is 0, always.
I'm confused, so is the problem on my side or is it Espruino ?function test(){ var interval; this.a = 0; interval = setInterval(function(){ a++; this.a++;console.log(a,this.a); },2000); } var b = new test();
-
-
I tried to interprete Boards and Pins files in javascript.
Its a new button in WEB IDE, which- opens a selectbox for boards
- reads board-info
- reads pins-info according to that
- creates groups of devices
- adds a selectbox for groups of devices
- selecting an item opens a tooltip
There are more options than on Espruino homepage.
I checked STM32F4Discovery and found CAN and SD ports.
On some pins I found more devices (e.g. PC10,PC11 are uart and usart)
Any idea what I forgot to check ? - opens a selectbox for boards
-
Hello Gordon,
thanks for the detailled feedback. I did not check the changes you mentioned yet, but I followed your suggestion to add functions to your WEB IDE.
There is a download for testing available at http://www.jumware.com/espruino/webapp/EspruinoWebIDE.zip
Changes, you can find them by searching for comment with "juergen" in.- added buttons for scripts, snippets and tutorials in main.html. All open a short form with a selectbox and a checkbox to switch between replace and append.
- added initialization of new buttons in terminal.js
- added a lot of plugins for codemirror in main.html
- added initialization for extensions in terminal.js
- added additional javascript to handle new buttons
- added a minify button in main.html. Opens a short form with selectbox for type of minify, a checkbox for sending directly to device, and a button to start minify
I would like any feedback. If this is helpful, feel free to do whatever you want withit.
Now lets go through other items: - I would not automate connecting/disconnecting to COM. I like to send infos to console during debugging, which would not appear anymore. I would prefer to switch this manually.
- the "problems" found by lint are not important, missing semicolon or spaces at the end. Don't waste any time on that.
- binary format is not only a problem of lint, its also a problem for minify. As soon as more browser will support this, the problem will disappear sooner or later. Please take it as a hint only.
- extensions for code completing and for lint to match functions and syntax fo Espruino is a good direction. Right now my lack of knowledge is the main hurdle doing this.
- I am not familiar with python, therefore I would like to wait for you wasting some time for creating JSON files ;-)
regards from Krefeld(Germany about 12 degrees celsius and rainy)
Juergen
- added buttons for scripts, snippets and tutorials in main.html. All open a short form with a selectbox and a checkbox to switch between replace and append.
@Frida, great job and good point.
I will check my other boards next week, but have to solder them first