I am in the final stages of the creation of my Esk8 remote. I've built the hardware, created a simple UI, and now I need to write the bluetooth communication.
I need some advice on how to create a bonded connection. I understand how promises work and the basic syntax of using nrf.connect().then.... to get the gatt and services/characteristics.
Is there an easy way to read/write a value of characteristic without using that long syntax? Can I go through the pairing/bonding process, save the characteristic object to a variable (i.e. char = characteristic returned) and just call char.writeValue(data) to update the characteristic?
Additionally, what is the reccomened transmitter/reciever setup? Should the reciever read a changing characteristic on the remote or should the remote(transmitter) write a value to a characteristic/service on the reciever?
To give more detail, the remote uses a hall effect sensor to detect the throttle position and I need to send a value to the reciever and then send a pwm signal to the ESC based on the throttles position.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I am in the final stages of the creation of my Esk8 remote. I've built the hardware, created a simple UI, and now I need to write the bluetooth communication.
I need some advice on how to create a bonded connection. I understand how promises work and the basic syntax of using nrf.connect().then.... to get the gatt and services/characteristics.
Is there an easy way to read/write a value of characteristic without using that long syntax? Can I go through the pairing/bonding process, save the characteristic object to a variable (i.e. char = characteristic returned) and just call char.writeValue(data) to update the characteristic?
Additionally, what is the reccomened transmitter/reciever setup? Should the reciever read a changing characteristic on the remote or should the remote(transmitter) write a value to a characteristic/service on the reciever?
To give more detail, the remote uses a hall effect sensor to detect the throttle position and I need to send a value to the reciever and then send a pwm signal to the ESC based on the throttles position.
Any help with this project would be appreciated.
4 Attachments