Scripting on iPad - accessing features like accelerometer, GPS, etc
Are there any scripting languages for the iPad that can access native functionality like accelerometer, GPS, text messages, etc?
I know that it is possible to write Scheme and Python scripts but I don't think they can access any of the native functionality.
Is there any way to do this?
If not, why not? Is it that Apple won't allow scripting environments in to the app store or is it the case that no one has bothered creating it?
techBASIC 3.1 supports the following connection and build-in sensor technologies:
Bluetooth LE.
WiFi via TCP/IP, HTTP, FTP.
HiJack (An A-D converter that plugs into the headphone jack).
Built-in accelerometer, gyroscope, magnetometer.
Access to composite information for heading, location (GPS/hotspot/cell tower), elevation, direction of travel.
Send emails (with user intervention).
Take photos or access the photo library.
It does not support:
The serial port. (It was implemented, but Apple would not allow this support to be released.)
Classic Bluetooth.
Receive emails. (Apple won't allow this.)
Send/receive text messages.
In my searching, I found this link that talks about GPS and Python from Sparkfun (https://www.sparkfun.com/tutorials/403)
I can't tell you I've used Python to read GPS, but this article is more complex. Besides using Python to get current GPS location, the author is building a GPS Radio Tracking System, and uses Python as the scripting language.
However, for apps I use either techBASIC, or another basic called SmartBASIC.
In one app I just use algebra and trig and geometry if I want to determine heading and using the built-in accelerometer, I can predict where the user will be in say 2 hours and produce a weather report by calculating what the anticipated GPS will be based on heading and speed of travel.
Most languages will give you native GPS data, and in SmartBASIC, it will also give you an off-by error, a +/- reading as well.
SmartBASIC, once you turn GPS on, it starts storing every point in an array, in case you are building an mapping app. You have access to all the past readings. If you want the current GPS, you need to loop your GPS call until there are no more readings.
In techBASIC, you can specify a wait period, which I believe has the same function.
I've tested both and the GPS readings are spot on. Even though you say the device's GPS sensor provides the same data, if you are not careful coding it, you will get different results.
Good luck.