Most recent activity
-
There is few joystick apps around. I looked through them but usually they are rather simple button type, limited control. I am aiming at something with more accuracy. Here is my prototype (my web development skills are very limited and its a work in progress):
https://kristosb.github.io/WebJoystick/
Also I dont want to go HID way straight away. I will follow @AkosLukacs suggestion and handle onwrite event after setting up NRF.setServices with custom data frame.
Right now I am trying to figure out if on WebBluetooth side I can stil use puck.js/uart.js or I need to go to lower level. -
@AkosLukacs Thanks, using onWrite in NRF.setServices seems to be what I was looking for. I am thinking about around 100ms update rate when the knobs for acceleration and steering are operated from joystick. Thats what I set the interval to on the webjoystick side. Like you say there is no big data payload. From what you are saying I dont need buffering. I can deal with it later once I test the setServices.
I guess I cant use the uart.js with default settings or at all on the web bluetooth side? Would be nice to see some example if you came across anything similar.@allObjects the heart beat is a good idea. I dont want the car to drive into walls full speed once it loses communication. That can be implemented easily. I will look into the Acknowledge on a later stage once I have basics working. Should be good idea for reliability.
-
I am wondering what is the best approach for updating a motor PWM over web bluetooth from the joystick or other device. In the past pre-espruino implementations I would just send data frame and commands would be just fired periodically (or on event) on the control board. With espruino you can send a whole command over BLE like:
mot.dcMotorControl(mot.dir.FWD,0.05);
I have a feeling if I do that with too hight update rate by moving a knob in my web joystick that would cause problems. It would be fine for toggling lights but not for continuously updated value. Do I just have to setInterval on the controller side or I could listen for an event from BLE? I think listening for an event would be best. Maybe with some mechanism for discarding uncaught events so they dont queue. Is there a best practice here?
-
Thanks. I will try this out with the we app I am working on. I added update for a joystick in the BolidJs project. I am still reading on the HID documentation. I wonder if it can do two way communication. I would like to be able to send information about the speed back to the controller. I have a gauge indicator there for speed. Its not necessary but would be cool if this works.
-
Project update:
I spend some time over Christmas break on the web joystick for the BolidJS. I feel like it should be separate project that could be used for other RC things. That might be idea for future or a fork of a current joystick. Anyway the code is here: repo WebJoystick and can be tested here: test WebJoystick
Right now its very prototype like with lots of debug features.
Main things to address:- controls scaling/placement
- for debug steering and acceleration knobs are directly wired to gauges
- no web bluetooth commands yet
The code needs some refactoring as well :) I feel like the tiny dash controls will have to be replaced with something that scales. Any suggestions for a library with gauges and graphs are welcome.
- controls scaling/placement
-
I did my own Espruino game controller a few months ago, which was basically a BLE HID keyboard with specific buttons.
I would be interested in looking into code for that if its open.
provide Espruino community with some game controllers examples will be very positive
I agree, it would be nice if there was such a device based on espruino for gaming or remote controlled cars/robots.
By the way, I really love the bolidJS project !
thanks, hopefully there will be big update after Christmas
-
Is the idea to build a joystick with espruino or be able to talk to the hacked Joy-Con like device? Personally I think it makes more sense to hack existing controller. Some of them even use processors that can be flashed with espruino. I did a quick hack of "daydream" like controller for a device called miraprism controller. There is lots of similar available to buy.
Long time ago I have build a controller from scratch and wasnt happy about it. Mainly because cheap knob modules you can buy have small usable range of movement. If you spend more money for proper modules you might as well buy already made whole thing.
Right now I am working on web joystick app that will communicate with my espruino over Web Bluetooth. Then I can just use it from my phone.
This is the project I need the joystick for. There is few post discussing joysticks options there: bolidJs
I would be interested if anyone comes up with a solution that can talk to espruino device. -
Thanks @opichals that looks cool and I didnt come across it. Right now I am focusing on bluetooth connection. Yesterday I had some luck making it work from both sides using custom services. A lot to learn.
Once I have the whole system going I will have to refactor a lot of things so keep the inspirations coming :) Scalable js buttons and gauges would be something I will be looking for.