DroidScript for easier use of the BusPirate on your Android device. Have a complete, although very basic, electronics bench in your pocket on the cheap. Full documentation: http://techref.massmind.org/techref/language/DroidScript/BusPirate/index.htm
BusPirate is a little open source device that connects a USB host device (PC, MAC, or cellphone / tablet via USB OTG) to electronic stuff. It can speak with several different busses (I2C, SPI, UART, etc...) and devices (LCDs, servos, AVRs, FPGAs, CPLDs, etc...) and can inject signals, or measure voltages. It's a little test bench in your pocket for less than $30.
The biggest problem with the BusPirate is that on the human side it speaks in very terse, hard to remember, codes. Turning the power on to the circuit under test requires you to enter "W". Setting up to talk to I2C is "m1". You get the idea.
The point of this script is to make that easy by providing a list of commands, with clear, English, descriptions, which then enter the code for you. You can edit it, then send that code to the device and see the response. If you setup a complex code that you will use often, you can save that code into the list with your own description.
Generic "Wizard" for commands that need parameters entered, based on description of the command. E.g. "#KHz" in the description means "add an edit field in the dialog box with KHz as the prompt, and accept numbers only." So "Generate #KHz %Duty" will, when selected, popup a dialog asking for the KHz and Duty and after those values are entered, it will put them into the command string to be sent. It can also display a list of options for the parameter selection wizard. e.g. "#Select 1=one 2=two" Displays a pull down with 1=one and 2=two as the options and "Select" as the description. Somewhat limited at this point as the text of the option must be a single word. e.g. 1=this one results in two entries in the spinner: "1=this" and "one". The text before the = (if present) is used as the output. This generic wizard is used by several commands to make them really easy to enter: I2C mode, SPI mode, 2 and 3 Wire mode, Generate Frequency Dutycycle, Repeat command
"Wizard" for selecting options to enter UART mode. This one is handled seperatly to provide a nicer layout of the standard UART settings.
"Voltmeter" mode where the ADC reading is repeatedly displayed in large letters, center screen. There is a user selectable scaling factor which is multiplied time the value displayed, and a calibrate button which powers up the internal supplies and explains how to connect a potentiometer so that the input voltage can be scaled, and the +5 power supply can be used as a voltage reference to calibrate the potentiometer. In order to automatically turn on the power supply, the app now tracks the BusPirate mode, and if it's in HiZ, it automatically switches to 1-Wire (can't turn on power in HiZ) and then switches back when finished.
For install guide, user manual see: http://techref.massmind.org/techref/language/DroidScript/BusPirate/index.htm
- Add a low frequency 'oscilloscope' mode using the binary ADC polling function. There are python scripts for this which can probably be translated. I'm not sure the DroidScript USB interface will handle binary data. Update: Sadly, it doesn't appear that the USB OTG interface on the phone can handle a continuous stream of data. This may be a limitation of my phone (currently a Samsung Galaxy 6) or of DroidScript. O'scope ain't going to happen!
- Provide some way to share custom codes with other users.
- Provide a way to reset custom commands back to the generic default commands.
- https://gist.github.com/JamesNewton/8b994528ff3ce69e60bbb67c40954cd2 Arduino based and less capable, but easy to use.
- http://www.thingiverse.com/make:66685 3D printed case and color coded label.
- http://dangerousprototypes.com/docs/Bus_Pirate_menu_options_guide Menu