Like I said, I thought I'd try installing the Android Development kit on the desktop. It took several hours, downloading JDK, Eclipse and the the SDK. Then there were all the other devices (I forget what they are called, anyway the modules for the various versions of stuff). I finally was able to see sensor graph working in the emulator about 8PM Sunday evening, but I was encouraged. Before I disappointed myself, I shut everything down. My family had just gotten home, and I didn't want to nerd out on them.
So tonight I thought I'd try it, and see how successful I was. A couple quick lessons in uploading apps to the Android (I needed the Sensor Graph app to be running). I needed to set the Bluetooth address in the application, so I needed to plug in the Arduino and run the Amarino app to see what the address is. Ok, it is 00:11:04:15:10:87, and I put that in the SensorGraph.java file in eclipse, ran compile, uploaded the .apk file to the phone, then ran the app installer on the phone. It connected.
I forgot a crucial step. The Arduino is still probably running my quad stepper app. I need the Sensor Graph app running on the phone too. I open the Arduino app and it wants install a software upgrade. I figure yea sure why not. Well, once it was installed, I remember why, the lib and sketches aren't there. Fortunately it didn't overwrite my original stuff, so I went back to the 0-22 version, and everything was there. Load library Hello Android and get my sensor graph running. Still nothing.
I open the serial monitor, and all I see is gibberish. Dang, baud rate is wrong. I change the baudrate to 9600, and I see "179 172 178 176 174" scrolling across the Arduino serial monitor screen. Cool! I had connected an LM34 temperature sensor to pin 15. It is doing something, but I should try something faster. There is some complicated instructions on the iTread studio stackable bluetooth shield web page about sending the AT commands to change the baud rate. I can't get it to work, but will be happy if 9600 baud works. I change the sketch to use 9600 baud, and upload that, I switch the switch from FT232 to board and viola! something is happening.
Well I get things looking good on the screen, I see the same numbers and the graph is a little jiggly, but mostly straight across the screen. I put my finger on the sensor, and it goes up. Thinking about how this works, and what the data sheet says, 10mv per degree F. What is the full range of a sensor (12bit or 8bit?). I got some research to do.
For those who might not believe, here are some crummy pictures (very hard to read, and big too).
No comments:
Post a Comment