Asked — Edited

Android Phone As A Gps, Compass And Tilt Sensor By Sending Uris To The Ez-Builde

Objective: Use my Android phone as a GPS, compass and tilt sensor by sending URIs to the ARC HTTP Server by writing a simple Android app the continuously reports URIs to the HTTP Server.

Situation: I have a variable in a EZ-Script control that is continuously running. EZ Script:


:Loop
Print($VarTest)
Goto(Loop)

I would like to set this variable($VarTest) value externally using the HTTP server control and have it value change reflected in the EZ-Script control that is running in a continuous loop in ARC.

So I execute this URL: http://192.168.1.67/Exec?password=test&script=$VarTest=1

This is returned: Syntax Error: Unknown command: $VarTest

Question: Is this possible? How is it done? Slightly off topic, are all user defined variables in ARC global in scope?


ARC Pro

Upgrade to ARC Pro

Elevate your robot's capabilities to the next level with Synthiam ARC Pro, unlocking a world of possibilities in robot programming.

PRO
Synthiam
#1  

That's a neat idea :)

HTTP URL has a few reserved characters. The = sign is one of them. Use the Url Encoding feature in your host development environment. Your URL would look like...


http://192.168.1.67/Exec?password=admin&script=$VarTest%3D1

Variables are global scope. You can tell by adding the "Variable Watcher". You can see the values of all variables. Also the forum Search will help you :)

This URL encoder may help you in the future: http://meyerweb.com/eric/tools/dencoder/

It's online. It'll help you to see what characters will need to be encoded in your string.

#2  

Seesh, I'm slapping myself. I done query strings so much in the past you'd think I would have caught the double equal sign on the last parameter. I think I was just momentary stunned by the power of ARC... eek

#3  

What I was day dreaming up the other day... You know aside from all those things guys normally think about.

Was cheap neatbook running ARC Andriod phone acting as wifi hotspot Netbook connected to the phone's wifi hotspot

Andriod phone reporting back to ARC its sensor data. Via what seems like the simplest method using query string script commands.

User-inserted image

Minus the kid, plus a twelve volt battery. Use a dremal to remove unwanted plastic. Add the h-Bridge and steering gear. BLAM! You've got a robot that can carry sixty pounds of gear and can go almost anywhere it can get cell reception. Best of all the dang thing's piloted by Buzz Light Year.

Okay, I know... the devil's in the engineering. Just a thought tho...

PRO
Synthiam
#4  

What's wrong with leaving the kid on there? :)

PRO
Synthiam
#5  

Also, even though it breaks the rules... I added support in the next release to read any character :)

#6  

Would you be willing to share the android app? I think your idea is a great one.

Alan

#7  

i am using a android phone as hotspot on my rc robot,i like your idea about the GPS, compass and tilt sensor