Monday, September 24, 2012

Operator Commands

Well, after a very focused dev session, I was able to add the support all of the command DB elements, allow manipulation of the individual command elements (like deleting them), and feeding them to the TinyG incrementally.  It's not perfect, but it's working pretty well.  Next up is to enhance the communications protocol between the Arduino and the tablet so that it does more than passes the info on to the TinyG.  More specifically, I want to be able to send it relay commands in JSON format as well as to enable a download mode that will open up a file for writing on the Arduino.  Once I get that done I'll do another demo.

Code isn't up on github yet, but I expect to get it up there before the project is done.  Need to think about how this code will mix with the other TinyG app before I put it up there.


Sunday, September 23, 2012

TinyG Operator Progress

I've made substantial progress on the Android - Arduino link over the past couple of weeks.  I posted this video to demo some of the new work.  Still on the docket is to construct actual gcode based on the input, and to store that in the system.

I'm using a database backend to store the programs and commands.  It turns out that's easier than manipulating raw files.  I'm also using the same service abstraction I used for TinyG for Android that allows selection of either network or USB host mode interaction.  So that means that I should be able to roll this USB Accessory mode capability into the core program without a lot of pain.

I've started to think about refactoring the existing TinyG for Android code.  Instead of having a separate app with the USB support, I'm probably going to make a multi-ADK release.  So this means that folks who can use the advanced features will automatically download one app with all the code, and the ones who can only use a subset of a capabilities will get another.  It should make some of the handling a little less tortured.

Thursday, September 6, 2012

Resources

I've been asked to put some of the resources I use for my projects all in one place.  Here are a few of my favorite things.  I regularly try to do video demos of my projects, and so for that take a look at my youtube channel.  Also, you can look at sites like hackaday for ideas, or even your local Buffalo Lab makerspace.

Arduino:

The main Arduino site itself is obvious, but I also like Sparkfun and Adafruit as both sources of ideas and for things like shields.  If you are going to use the USB Shield or the Mega ADK board, the Circuits@Home site is very useful as well.  Also, don't forget about the "examples" that are available within the Arduino IDE itself.

If you are planning to skip the Arduino IDE and "sketch" system completely and build code like your forefathers, you need to understand the underlying chipset and have a working toolchain.  It is very instructive to write a simple C program, have it be compiled to assembly, and to try to discern what that code does.  You get extra points if you grok relocatable code and understand what a linker does.  When you finally have object code to upload to the device, you need to choose how to do that last step.  Fortunately, the Arduino hardware has a built in method of flashing the firmware via the USB port.  You can get an AVR programmer if you want to be hard core, or you have a board that doesn't have the secondary bootloader.

When I'm doing electronic design work, I usually pull parts from places like Jameco and Digikey.  there are others, but between these two you can find almost anything.

Random tip: Always be aware of what voltage logic you're using.  For example, most Arduino boards are 5v, which means they output 5v as a "1" and they have a fairly high voltage threshold for inputs to be considered a "1" (I think something like 2.7v).  If you're trying to interface with a device that is based on 3.3v logic or even lower, you can get odd results or even damage your devices.  There are ways to do level shifting using options as simple as a voltage divider.

There are some standard ways to do things like light an LED from an output pin or "debounce" a switch that is attached to an input.  Understand how these simple circuits work.

Android:

The developer site is a great resource, as is all of the free code on Github (including my stuff).  If you need help, a google search usually turns something up on stack overflow.

Hope that helps some.  Let me know if I missed anything useful.