borg Geschrieben March 20, 2014 at 19:35 Geschrieben March 20, 2014 at 19:35 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 . Zitieren
Gast Robin Geschrieben March 24, 2014 at 14:46 Geschrieben March 24, 2014 at 14:46 Hey Borg, were you able to reproduce the problem? Zitieren
borg Geschrieben March 24, 2014 at 17:33 Geschrieben March 24, 2014 at 17:33 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> Zitieren
borg Geschrieben March 26, 2014 at 13:56 Geschrieben March 26, 2014 at 13:56 I just added a small first version of the IMU Brick plugin that uses WebGL to show the IMU Brick, which works pretty good . Zitieren
Fygo Geschrieben April 9, 2014 at 16:52 Geschrieben April 9, 2014 at 16:52 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. Zitieren
Gast Robin Geschrieben April 9, 2014 at 16:55 Geschrieben April 9, 2014 at 16:55 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. Zitieren
Fygo Geschrieben April 9, 2014 at 17:00 Geschrieben April 9, 2014 at 17:00 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. Zitieren
borg Geschrieben April 9, 2014 at 17:05 Geschrieben April 9, 2014 at 17:05 @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. Zitieren
Fygo Geschrieben April 9, 2014 at 17:07 Geschrieben April 9, 2014 at 17:07 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. Zitieren
borg Geschrieben April 9, 2014 at 17:39 Geschrieben April 9, 2014 at 17:39 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 Zitieren
Fygo Geschrieben April 14, 2014 at 22:06 Geschrieben April 14, 2014 at 22:06 Excellent, works awesome now! Thanks a lot! Zitieren
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.