Project Updates for 3/19/2013

Today I figured out how to update a text field from a thread by using the TextView's .post() method. I ended up creating a function that I can just call with the string and it tells the UI to update the text field. Anyhow, after I did that, I found a few errors in my code and fixed those. I looked into the USB specification documentation to figure out exactly what exactly the commands I found online to send to the arduino did. After some analysis, I found that it sets the Serial Line to 9600,1n8. However, my arduino was trying to talk at 57600, so I figured out the correct bytes to send it to request that speed. Now when I plug the arduino in, it tells me how many bytes were transmitted via bulkTransfer and the receive light on the arduino flashes.

I'm trying to turn on the built-in LED on the board, but for some reason it won't turn on when connected to the Android, even if all I have is code that tells it to turn on, so I need another way to test that data is being received. Most likely the arduino is correctly receiving the data at this point, but I don't like running blind with it when I'm doing things I've never done before. I'll probably try using other pins on the arduino and hooking up an external LED to see if that resolves the issue. Once I get the sending and receiving working on the Arduino Mega, I'll try getting it working on my diecimila. I'd like this project to work on all arduinos and I'm trying to write the code in such a way in case I decide to go with a different arduino in the future.

Posted in Old Posts 19 Mar 2013