borg Posted March 20, 2014 at 07:35 PM Posted March 20, 2014 at 07:35 PM I just added support for multiple graphs in one graph view and implemented it for the Temperature IR Bricklet. I will take a look at the setMode function tomorrow. Edit: I don't like the distance between the two temperature <h3>'s in the new temp ir plugin and the text below the graph is a bit to close. But the good thing is that we can easily beautify the HTML later on, it will then automatically work for all graphs in the plugins . Quote
Guest Robin Posted March 24, 2014 at 02:46 PM Posted March 24, 2014 at 02:46 PM Hey Borg, were you able to reproduce the problem? Quote
borg Posted March 24, 2014 at 05:33 PM Posted March 24, 2014 at 05:33 PM It works for me. I just used one of our standard examples and called the setMode function: <!DOCTYPE html> <html> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <head> <title>Tinkerforge | JavaScript Example</title> </head> <body> <div style="text-align:center;"> <h1>Analog Out Bricklet Simple Example</h1> <p> <input value="localhost" id="host" type="text" size="20">: <input value="4280" id="port" type="text" size="5">, <input value="uid" id="uid" type="text" size="5"> <input value="Start Example" id="start" type="button" onclick="startExample();"> </p> <p> <textarea id="text" cols="80" rows="24" style="resize:none;" >Press "Start Example" to begin ...</textarea> </p> <div> <script src="./Tinkerforge.js" type='text/javascript'></script> <script type='text/javascript'> var ipcon; var textArea = document.getElementById("text"); function startExample() { textArea.value = ""; var HOST = document.getElementById("host").value; var PORT = parseInt(document.getElementById("port").value); var UID = document.getElementById("uid").value; if(ipcon !== undefined) { ipcon.disconnect(); } ipcon = new Tinkerforge.IPConnection(); // Create IP connection var ao = new Tinkerforge.BrickletAnalogOut(UID, ipcon); // Create device object ipcon.connect(HOST, PORT, function(error) { textArea.value += 'Error: '+error+ '\n'; } ); // Connect to brickd // Don't use device before ipcon is connected ipcon.on(Tinkerforge.IPConnection.CALLBACK_CONNECTED, function(connectReason) { ao.setMode(Tinkerforge.BrickletAnalogOut.MODE_1K_TO_GROUND); } ); } </script> </body> </html> Quote
borg Posted March 26, 2014 at 01:56 PM Posted March 26, 2014 at 01:56 PM I just added a small first version of the IMU Brick plugin that uses WebGL to show the IMU Brick, which works pretty good . Quote
Fygo Posted April 9, 2014 at 04:52 PM Posted April 9, 2014 at 04:52 PM Hey guys! I have just downloaded the JS API (I assume it is fresh from the oven, I didn't see it yesterday) and was trying the browser implementation but no go. I cannot seem to connect the device at all, I am always getting error 13. Basically I just copied over the browser implementation JS file and put it to the html files, does it need anything else? I am not using node.js and I haven't tested that version. Your feedback is much appreciated! Thanks. Quote
Guest Robin Posted April 9, 2014 at 04:55 PM Posted April 9, 2014 at 04:55 PM Did you already try the examples? Which version of brickD do you use? You need the latest update of brickD which was released to today to use the examples. Quote
Fygo Posted April 9, 2014 at 05:00 PM Posted April 9, 2014 at 05:00 PM brickd, brickv - both version 2.1.0. Using Brick IMU 1.2. The device appears alright in the viewer. The JS examples don't work, code 13 all the time. Test on OS X 10.9.2 with the latest FF and Chrome. Quote
borg Posted April 9, 2014 at 05:05 PM Posted April 9, 2014 at 05:05 PM @Fygo: We currently still in the process of releasing the JavaScript Bindings, so you are very early . By default the websockets are disabled in the brickd, but the documentation on how to enable it is not yet online . Give me a few more minutes, then i can give you a link. Quote
Fygo Posted April 9, 2014 at 05:07 PM Posted April 9, 2014 at 05:07 PM Ah, I didn't know that! Seems like I am an early adopter. Take your time, guys! Will check back in a few hours / tomorrow / etc. Thanks a lot. Quote
borg Posted April 9, 2014 at 05:39 PM Posted April 9, 2014 at 05:39 PM The missing documentation is now online: http://www.tinkerforge.com/en/doc/Software/Brickd.html#websockets http://www.tinkerforge.com/en/doc/Software/API_Bindings_JavaScript.html#testing-a-html-example Quote
Fygo Posted April 14, 2014 at 10:06 PM Posted April 14, 2014 at 10:06 PM Excellent, works awesome now! Thanks a lot! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.