Scientists and hobbyists who want to use their iOS devices as tricorders now have a new tool to help them to bring that dream to life. Byte Works has released version 2.0 of techBASIC, a US$14.99 scientific and educational programming environment for iOS that can be used to pull in data from internal (accelerometer, magnetometer, and gyroscope) and external sensors.
In case the name Byte Works sounds familiar to some of you, the company has been around for a long time. Mike and Patty Westerfield started the company in the early 1980s, developing the ORCA computer languages for the 8-bit Apple II. ORCA/M became the standard development system for the Apple IIGS under the names Cortland Programmer's Workshop (CPW) and Apple Programmer's Workshop (APW). techBASIC has its roots in another Byte Works product, GSoft Basic for the Apple IIGS.
techBASIC 2.0 is a universal app, so any program you develop on your iPhone can easily be run on your iPad or vice-versa. Launching the app on the iPhone displays a list of included example programs -- the source code for these programs is a nice place to pick up some tips on how to access and use readings from the sensors built into iOS devices. The iPad version shows the list of programs and also provides a window showing the graphical output of your programming efforts.
Of course, you cannot create apps for sale in the app store with techBASIC. However, you can send your code to others through email. I'd personally like to see techBASIC work with Dropbox or iCloud for storing self-created apps online for backup and sharing.
A tap on any one of the program names displays its source code. The example programs are not only useful, but well-commented for educational purposes. In both the iPhone and iPad flavors, techBASIC includes buttons to display the source code, show a console, see graphics being generated by your program, etc... If you need to, it's possible to step through a program to see how it works or to debug an issue.
The documentation for techBASIC is available online, consisting of a reference manual and individual Quick Start guides for iPhone and iPad. There's also a built-in help system with full details of statements, functions, events, graphics classes, GUI classes, sensor classes, and system classes.
Perhaps one of the coolest features of techBASIC 2.0 is the ability to tap into the sensors of your favorite iOS devices. The language provides a way to tap into the accelerometer, magnetometer, and gyroscope, and also to grab your current latitude-longitude, altitude, and more. There's a separate sensor class for the HiJack hardware, a University of Michigan project to add small sensor packages to iOS devices. The techBASIC blog features an example app showing how to grab readings from a HiJack-connected potentiometer. The potential here is huge -- imagine being able to connect HiJack to a thermocouple to grab a temperature log through techBASIC, or to an anemometer to measure and track wind velocity on an iPad or iPhone.
One of the reviewers listed on the Byte Works website notes that she feels that techBASIC is a "mini-MATLAB in my pocket." I have to agree. While techBASIC isn't nearly as high-powered as MATLAB, it's more amenable and affordable to those who want a lot of the same capabilities to analyze and visualize data.
I won't go into a huge, detailed description of the techBASIC language here, since the documentation is readily available. But I will say that this is an excellent development environment for researchers or anyone with an iOS device who enjoys tinkering with hardware. For students, techBASIC is an inexpensive way to learn about programming. Be sure to check out the gallery to see screenshots from both the iPhone and iPad, and watch the video below for a look at techBASIC in action.