I am a complete newbie when it comes to java script and HTML. Currently working on a rc boat that is controlled through a web page and so far I have one set up using range sliders that control direction and power. I want to move on to java script to use WASD as the inputs for direction and power but don’t really know how to implement it due to my lack of java script knowledge. I was wondering how you connect the particle api to a script and use a cloud function within the script because I understand how to use it in HTML in a form. Any help or tips are appreciated because I do not really know where to get started besides using the event function to watch for a keystroke.
Thanks in advance.
But at this point what would I put to assign a string value for the cloud function direction to return to particle? Because in my HTML program the range slider will return a string of “0” when it is slide to the left so in this script when a is pressed I want to send a value of 0 to the program.
The web page is sort of working for me but after every keystroke it detects it brings me to the api.particle.io page telling what value it returned. Is there anyway to stop that from happening because it is causing my code not to perform correctly because it does not detect the on.keyup because it redirects to the api page.