Show Posts
|
|
Pages: [1] 2 3
|
|
1
|
Using Arduino / Project Guidance / Re: teleduino pan tilt html question
|
on: April 08, 2013, 04:56:39 am
|
The download prompt is likely to be caused by the content-type header that is returned from the Teleduino server. There is an optional parameter that can be set to determine the returned format of the response. Try adding one of the following to the end of the Teleduino API call URL: - &o=json (This is actually the default. It returns a content-type of application/json)
- &o=jsonp (Returns a content-type of application/javascript, but may result in a javascript error being displayed because the callback function likely doesn't exist on your local page)
- &o=php (Recommended to try. Returns a content-type of text/plain. The result is encoded as a PHP serialised string)
|
|
|
|
|
2
|
Using Arduino / Project Guidance / Re: teleduino pan tilt html question
|
on: April 06, 2013, 05:02:20 am
|
There are two common ways to achieve this, the easiest being to set the target of the links to an iframe, so the Teleduino response is output to the iframe rather than the browser window. If you don't want to see the output, you can set the height and width of the iframe to 0 - but you may be interested in seeing the response! The second method is via an ajax call using jQuery. So, to go with the easiest method, you need to add an iframe with an id, and then set the target of the links to the id of the iframe. Example code: <!DOCTYPE html> <html> <body>
<h1>My Arduino/Teleduino Powered Pan Tilt WebCam Mount</h1>
<h3>Live Cam via Ustream</h3> <p align="center"> <iframe width="600" height="482" src="http://www.ustream.tv/embed/2598779?v=3&wmode=direct" scrolling="no" frameborder="0" style="border: 0px none transparent;"> </iframe> <br><a href="http://www.ustream.tv/" style="padding: 2px 0px 4px; width: 400px; background: #ffffff; display: block; color: #000000; font-weight: normal; font-size: 10px; text-decoration: underline; text-align: center;" target="_blank">Live Video streaming by Ustream</a> <a href="http://www.ustream.tv/channel/tnap1979">www.ustream.tv/channel/tnap1979</a> </p>
<h3>Servo Power Toggle</h3> <a target="teleduino_output" href="http://us01.proxy.teleduino.org/api/1.0/328.php?k={key}&r=setDigitalOutput&pin=4&output=2">toggle On/Off Servos</a>
<h3>Pan Servo Controls</h3> <a target="teleduino_output" href="http://us01.proxy.teleduino.org/api/1.0/328.php?k={key}&r=setServo&servo=0&position=130">Left Max -</a><a target="teleduino_output" href="http://us01.proxy.teleduino.org/api/1.0/328.php?k={key}&r=setServo&servo=0&position=75">- Right Max</a>
<a target="teleduino_output" href="http://us01.proxy.teleduino.org/api/1.0/328.php?k={key}&r=setServo&servo=0&position=122">Left Mid -</a><a target="teleduino_output" href="http://us01.proxy.teleduino.org/api/1.0/328.php?k={key}&r=setServo&servo=0&position=83">- Right Mid</a>
<a target="teleduino_output" href="http://us01.proxy.teleduino.org/api/1.0/328.php?k={key}&r=setServo&servo=0&position=115">Left Min -</a><a target="teleduino_output" href="http://us01.proxy.teleduino.org/api/1.0/328.php?k={key}&r=setServo&servo=0&position=90">- Right Min</a>
<a target="teleduino_output" href="http://us01.proxy.teleduino.org/api/1.0/328.php?k={key}&r=setServo&servo=0&position=105">Center</a>
<h3>Tilt Servo Controls</h3> <a target="teleduino_output" href="http://us01.proxy.teleduino.org/api/1.0/328.php?k={key}&r=setServo&servo=1&position=85">Up Max -</a><a target="teleduino_output" href="http://us01.proxy.teleduino.org/api/1.0/328.php?k={key}&r=setServo&servo=1&position=30">- Down Max</a>
<a target="teleduino_output" href="http://us01.proxy.teleduino.org/api/1.0/328.php?k={key}&r=setServo&servo=1&position=75">Up Mid -</a><a target="teleduino_output" href="http://us01.proxy.teleduino.org/api/1.0/328.php?k={key}&r=setServo&servo=1&position=41">- Down Mid</a>
<a target="teleduino_output" href="http://us01.proxy.teleduino.org/api/1.0/328.php?k={key}&r=setServo&servo=1&position=69">Up Min -</a><a target="teleduino_output" href="http://us01.proxy.teleduino.org/api/1.0/328.php?k={key}&r=setServo&servo=1&position=53">- Down Min</a>
<a target="teleduino_output" href="http://us01.proxy.teleduino.org/api/1.0/328.php?k={key}&r=setServo&servo=1&position=65">Center</a>
<h1>Enable Teleduino Servos Functions</h1> <a target="teleduino_output" href="http://us01.proxy.teleduino.org/api/1.0/328.php?k={key}&r=definePinMode&pin=4&mode=1">Enable Servo Power Control</a> <a target="teleduino_output" href="http://us01.proxy.teleduino.org/api/1.0/328.php?k={key}&r=defineServo&servo=0&pin=9">Enable Pan Servo</a> <a target="teleduino_output" href="http://us01.proxy.teleduino.org/api/1.0/328.php?k={key}&r=defineServo&servo=1&pin=7">Enable Tilt Servo</a>
<br /> <iframe id="teleduino_output" width="600" height="40"></iframe>
</body> </html> On a side note, I see that you have some links to call definePinMode and defineServo. Did you know that you can set presets on your Teleduino so that when the device boots up it would define these automatically? The tool is available at https://www.teleduino.org/tools/manage-presets
|
|
|
|
|
3
|
Using Arduino / Networking, Protocols, and Devices / Re: Help using teleduino to trigger functions
|
on: December 01, 2012, 09:18:05 pm
|
Hi there. All the magic happens within the Teleduino library itself, and is triggered by the line: Teleduino.instruction(data); which is where it retrieves the request from the data array, performs the action, then populates the same array with the result. Adding custom functionality would be a case of wrapping some code around the above line, and then using the basic API (which unfortunately is not documented, but is straight forward once you know the details). Some example code of a function that doesn't require parameters in the request and doesn't return anything (use to replace the above mentioned line): switch(data[0]) { case 0xF0: myFunction(); // Replace with your function data[0] = 1; data[1] = 0; break; default: Teleduino.instruction(data); break; } Once you've got that in place, you could call the function with the following API call: https://us01.proxy.teleduino.org/api/1.0/basic.php?k=YOUR_API_KEY&r=F000 The main concern may be the amount of memory consumed by your function. If you find the device is unstable or inoperable, you may need to remove some of the functionality from the library that you don't need. You can check the amount of free memory using the getFreeMemory API call. Hope that helps! Let me know if you need to send/receive values to your function.
|
|
|
|
|
8
|
Using Arduino / Sensors / Re: Processing 2 Analogue Inputs To Create Differential Value
|
on: July 26, 2012, 06:11:46 am
|
I've read posts about allowing time for the ADC to switch and read the value of a different pin, does this still need to be put into consideration or is it handled internally? For example, if it were still relevant, you may find you get more stable readings from the following: int chan_diff () { analogRead (pin1) ; delay (10) ; int ch1 = analogRead (pin1) ; analogRead (pin2) ; delay (10) ; int ch2 = analogRead (pin2) ; ch1 += analogRead (pin1) ; ch1 >>= 1 ; return ch1 - ch2 ; }
|
|
|
|
|
12
|
Community / Products and Services / Re: Beta Users Needed - Teleduino - Control your Arduino via a web service
|
on: May 21, 2012, 05:48:16 am
|
|
The heartbeat does look neat on the Adafruit Printer. If you like, you could modify the part of the Teleduino library that is used for the 'ping' method (lines 232 - 249 of version 328-0.6.5). You'll need to select a different pin for the status LED in the header part of the sketch, one that supports PWM. Just make sure that the method doesn't take too long to execute because it ties up the Arduino and would cause other instructions to get queued (the current ping method only delays for 10ms).
The reason behind using pin 8 for the status LED is to keep the PWM outputs available for projects (otherwise it would have made sense to use pin 9, so that it's physically next to the 4 pins that are used by the Ethernet shield).
Thanks!
|
|
|
|
|
13
|
Community / Products and Services / Re: Beta Users Needed - Teleduino - Control your Arduino via a web service
|
on: May 19, 2012, 07:36:50 pm
|
|
Looks like a really neat project! Thanks for posting the pic. I'm a little unsure about what you mean about the PWM outputs resetting? The only time they would reset would be if the Arduino rebooted, in which case the output would be set to the default value defined in the EEPROM. If you're using a voltmeter to measure the output, you'll find that it always reads approximately 5V because it's not a variable voltage output, it's just switching between 0v and 5v at X number of hertz.
|
|
|
|
|
14
|
Community / Products and Services / Re: Beta Users Needed - Teleduino - Control your Arduino via a web service
|
on: May 14, 2012, 04:48:20 am
|
mr_roboto, Many thanks for the kind words, and for the positive feedback. With a well configured device it shouldn't matter too much about the occasional reboots. You can set preset values for most of the functions, that get set on boot. For example, pinModes, serial port baud, servos, etc etc. You can set the presets for your device by using the (currently ugly, but working well!) interface at http://www.teleduino.org/tools/manage_presets.php?k={key} (replace {key} with your API key). You're right about the inputs values. They will be picked up at the next poll. Triggers/hooks haven't been implemented at this stage of the project as I wanted to see how it gets used as it currently stands and work forward from user feedback. The servos are awesome to play with. I'd highly recommend using an external power source for the servos, as you'll most likely experience reboots if you're powering the servos as the Teleduino from the USB port. Thanks again!
|
|
|
|
|
15
|
Community / Products and Services / Re: Beta Users Needed - Teleduino - Control your Arduino via a web service
|
on: May 13, 2012, 08:16:32 pm
|
|
Hi mr_roboto,
Thanks for trying it out!
Interesting that you're experiencing reboots. Can I ask how frequent they are occurring? Typically devices would stay online for days at a time - it all depends on how reliable your internet connection is.
If you've added some further code, then it's possible that the device is running out of memory? The other possibility is that any attached devices/sensors are drawing too much current and causing the device to reboot? Send me a PM if you would like me to assist you with troubleshooting. If you include your API key in the PM (don't post it in the public forum) then I can check the server logs to see if that provides any clues.
On a side note, I have published some tutorials on Instructables. People can now automatically generate API keys, and there are some example projects posted. Simply search for 'Teleduino' at instructables.com.
Thanks!
|
|
|
|
|