Write commands from react native application #3293
Replies: 7 comments
-
|
Posted at 2020-02-12 by Robin Tue 2020.02.11 Well hello @user109470 and welcome to Espruino! See the examples here, and ask away . . .
Would links to Javascript only sites aid here? |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2020-02-12 by @gfwilliams You might find this handy: http://www.espruino.com/About+Bluetooth+LE#services-and-characteristics It's the For instance: Will let you change the state of the 3 LEDs. Your other option is to write raw JS code to the 'UART' characteristic on Puck.js - it's a bit less efficient but that way you don't have to have any specific code on the Puck... |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2020-02-12 by user109470 Thank you so much! |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2020-02-13 by Robin Wed 2020.02.12 My favorite I like to introduce individuals to: as each concept has a 'try it yourself' window, where basic edits may be entered. Mozilla repository:
International Standards body: From post #4
Was this a reference to the snippet in post #3 ? (e.g. that snippet appeared below the 'reply to edit' window when editting the reply, [even though post #3 occurred before your edit] rather than code that was intended to be uploaded?) I believe it is the setServices() function you are after:
|
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2020-02-13 by @gfwilliams Hi Robin, I think @user109470 has got the hang of the JS side of things.
Yes, |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2020-02-13 by user109470 Thank you all for the help! I tried uploading the example code to the puck, but when I connect to it from the react native app and printing out all characteristics, I can't seem to find the one I supposedly created using NRF.setServices(). Espruino Code: RN code: |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2020-02-14 by @gfwilliams You could try manually disabling bluetooth on the device and re-enabling it. I know iOS (and newer Android?) actually cache the Bluetooth services for devices so if you connected to the device previously then the phone might be giving you old info on services? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2020-02-11 by user109470
Hi everyone!
I have a puck.js which I would like to use to control a robotic car, made up of 4 servomotors. In order to control this, I'd want to send the commands to the puck via BLE having a react native application as interface.
I manged to identify the characteristics I can write to, but I don't know hoe to code the puck so that it reads these characteristics and acts upon what is communicated through them.
Does anyone have any idea how to help me with this task? Or knows of any effective tutorials I can look into...
I am quite new to the javascript-bluetooth world so any help is deeply appreciated.
Silvia
Beta Was this translation helpful? Give feedback.
All reactions