-
I mean the espruino firmware, you previously had to install some espruino_XXX_microbit2.hex file from https://www.espruino.com/Download
Oh yes! I've done this previously.
Current version is shown in bottom right corner when you connect via WebIDE or via typing process.env or process.version on left side
I read 2v10.113
In download page I see espruino_2v10_microbit2.hex and espruino_2v10.142_microbit2.hex as Cutting Edge build.Is it possible that I have installed the previous Cutting Edge Version (113) instead of 2V10?
-
-
Hi - you need to send multiple keys like is shown in the example you linked
Hi @Gordon and thank you very much.
I saw the example, but I was looking for another solution because a keystroke should be sent in a part of the code and another in a different part.
I imagined that was a problem of time, as you confirmed.
So I'll try with some other workaround in my codeoh, ok, sorry, was thinking v1 due to uart overflow in the other thread http://forum.espruino.com/conversations/369059/ but now I see yet another thread created by @coat with V2 in name
@fanoush yes, mine is micro:bit v2. I was not precise in my request, I'm sorry and thank you for your help. I really don't know what UART_OVERFLOW error wants from me
I'm still receiving also this error (or similar) when finally I flash the code
Uncaught Error: Not connected! at line 1 col 104 ...0,0,0],function(){a&&a()})}) ^ in function "tap" called from line 48 col 36 kb.tap(kb.KEY.G,0); ^
But again I don't know what it means
-
-
Hi!
I noticed that, using the example code of Bluetooth LE HID Keyboards (here), if i writekb.tap(kb.KEY.A,0); kb.tap(kb.KEY.N,0);
the micro:bit send only the first letter (a).
Is there a workaround or somthing to do to allow the board to send more letters?
Thanks!
-
-
Hi again!
I'm trying to make a BLE keyboard with micro:bit to send a keystroke when it is tilted to the right, left, front, back.
This is my code (I've not finish to write all)var kb = require("ble_hid_keyboard"); NRF.setServices(undefined, { hid : kb.report }); var min = -400; var max = 400; var x = Microbit.accel().x*1000; var y = Microbit.accel().y*1000; var z = Microbit.accel().z*1000; if (x > min && x < max && (y > min && y < max && z < (-800))){ kb.tap(kb.KEY.A); } else { if (x > min && x < max && (y > min && y < max && z > 800)) { kb.tap(kb.KEY.F); } else { if (x > min && x < max && (z > min && z < max && y > 800)) { kb.tap(kb.KEY.D); } else { if (x > min && x < max && (z > min && z < max && y < (-800))) { kb.tap(kb.KEY.E); } else { if (y > min && y < max && (z > min && z < max && x > 800)) { kb.tap(kb.KEY.B); } else { if (y > min && y < max && (z > min && z < max && x < (-800))) kb.tap(kb.KEY.C); } } } } }
I'm using the example of BLE Keyboard here and I receive this error
Uncaught TypeError: Expecting a number or something iterable, got undefined at line 1 col 104 ...0,0,0],function(){a&&a()})}) ^ in function "tap" called from line 16 col 18 kb.tap(kb.KEY.A); ^
or this one
>New interpreter error: UART_OVERFLOW >Uncaught ReferenceError: "requirerage" is not defined at line 2 col 1 requirerage").write(".bootcde","85,\nPAD_MINUS:86,PAD_PLUS:8... ^ Uncaught SyntaxError: Got '}' expected ',' at line 11 col 5 } ^
If I make a test with just
print("A");
instead of
kb.tap(kb.KEY.A);
I've no error and the code works as I want.
What it can be?
-
-
Hi everyone.
I'm trying to write a code that give the acceleration of X axis and, if it's major than 45° something happens.
UsingMicrobit.accel()
I have a string like this
{ "x": 0.115234375, "y": -0.37109375, "z": -0.951171875 }
First of all, what is this measure unit?
How can I get degrees?
And....is there a way to get X, Y and Z separately?Thanks
-
So just to confirm: you were previously using the 'Chrome app IDE' - this one? https://chrome.google.com/webstore/detail/espruino-web-ide/bleoifhkdalbjfbobjackfdifdneehpo
Yes, it is.
And https://www.espruino.com/ide/ works?
Yes, it works
But, I think I am a very stupid person.
I remembered that the serial connection with microbit is at 115200 (using Putty) so I changed this setting when I first logged into the IDE.
Setting at the default baud rate (9600), now also the Chrome IDE works.I'm very sorry for my mistake and thank you for your support
-
Hi Robin and thanks for your help.
So to confirm, as I understand the above, what does work is to cut-n-paste into the R-Hand editor side only?
Yes, I can only write and cut-n-paste into the Right-Hand editor side. On the Left-hand side I can't do anything.
Are you connected by the USB cable from a port on the PC? (to remove Bluetooth connectivity as a possibility using battery)
Yes, I'm connected by USB. When I open Espruino IDE, I click on the Connect/Disconnect button on the top left corner and select COM8 mBed serial port.
Was an attempt to disconnect or power down, then re-connect or power up, done?
Yes, I have try yesterday and this morning too. On the left-hand editor side I see the message Unable to retrieve board information. Connection Error? and immediatly below Connected to COM8 (No response from board) but the code is upload correctly.
After the numerous 'Initialising Utils, Initialising Config, . . .' entries, are any other errors reported within the IDE console output?
I can see a Warning advise. Here you can find what console writes after all the initialising:
No code in storage. GET chrome.storage.local.OFFLINE_DATA = 0 bytes >>> Connecting... Set Slow Write = true [object Object] Connected [object Object] Got "" No Prompt found, got undefined - issuing Ctrl-C to try and break out Splitting for Ctrl-C, delay 250 Still no prompt - issuing another Ctrl-C Splitting for Ctrl-C, delay 250 >>> Sending... ---> "\u0010print(\"<\",\"<<\",JSON.stringify(process.env),\">>\",\">\")\n" >>> Sent >>> Receiving... WARNING: No result found for "process.env" - just got "" >>> ERROR: [notify_error] Unable to retrieve board information. Connection Error? Device found {"bitrate":115200,"bufferSize":4096,"connectionId":3,"ctsFlowControl":false,"dataBits":"eight","name":"","parityBit":"no","paused":true,"persistent":false,"receiveTimeout":0,"sendTimeout":0,"stopBits":"one"} [success] Connected to COM8 (No response from board) >>> Connected to COM8 (No response from board)
What IDE version is displayed?
In Settings >> About I read 0.74.1
From that image, I see that a recent flash of Espruino was done. Was this flashed using the WebIDE itself, or some other means?
I have use just WebIDE
While the Chrome browser is mentioned, what is the PC OS the Chrome browser is running on?
Windows 10 21H1
By chance have you tried the online IDE directly?
Oh here works!
Initially, when I have click Connect/Disconnect button then on Web Serial it has find mbed serial port COM8 it says Connection failed.
Trying again, it has find MicrobitV2 and now I can write on left-hand emulator side and also the other examples work!But why?
-
Hi Gordon.
I have simply copy and past the code on Epruino IDE and click on Send to Espruino (Flash).
Effectively, When I upload, a message say "Prompt not detected - upload failed. Trying to recover..." but it's the same with keyboard BLE and it works, so I've just ignore it.I can't write on the left-hand side.
There is the blinking cursor there, but I'm not able to write anything.
It's strange.....This is my IDE.
As you can see, I can't write neither following the tutorial.....I don't know why.
I'm using Google Chrome and Espruino Web IDE from Chrome Extensions -
Hi everyone.
I'm new here and I would learn to program my microbit v2 with espruino.
So, I've connect my board to Espruino Web IDE. So far so good.
But when I try the examples here it seems that they doesn't work.For example, I have flash on micro:bit this one
show("1 1\n"+ " 1 \n"+ " 1 \n"+ "1 1\n"+ " 111 \n");
but nothing happens.
Then I have try with the following one
g = Graphics.createArrayBuffer(5,5,1); g.flip = function(){show(this.buffer);}; var x = 0; setInterval(function() { x++; if (x>50)x=0; g.clear(); g.drawString("Espruino",5-x); g.flip(); }, 100);
But nothing.
Instead, when I have try the BLE keyboard example:
var kb = require("ble_hid_keyboard"); NRF.setServices(undefined, { hid : kb.report }); function btnPressed() { // Send 'a' kb.tap(kb.KEY.A, 0, function() { // Followed by capital 'A' kb.tap(kb.KEY.A, kb.MODIFY.SHIFT); }); } // trigger btnPressed whenever the button is pressed setWatch(btnPressed, BTN, {edge:"rising",repeat:true,debounce:50});
It worked (but only when I press A button, not B).
Where am I wrong?
Thank you for your replies!
No way.
I tried 2v10 and 2v10.142 but nothing changed.
Still have the error
Anyway, the code is working, as before, with no problem