Monday, February 25, 2013

Slower Progress

Ended up doing crap yesterday while I figured out how I wanted to handle the PC side of things. Decided that I didn't really want to learn win32 so I ended up switching to python.

Meanwhile I write a new serial driver, complete with debug mode. Generally the idea is that the micro will ask the computer for locations, and the computer will respond in a somewhat timely manner. That way I don't have to worry about the computer overwhelming the micro or the serial bus. The messages will be fixed length, and i'll just pad them out.
The micro message is just 'g', for 'get data'.
There are two computer>micro messages, of 6 bytes length:

  • "pXX000" where XX is a 12 byte number spread over two bytes and masked with 01xxxxxx01xxxxxx. This is the position and legal values will just be 0-1024.
  • "s00000": Stop. 
edit: no this is dumb, I will just use begin/end message characters, and escape characters. way way easier.



Debug mode occurs when the handshake fails and is just a terminal interface.  For some reason it seems a little slow/buggy, but I think it's just the terminal program in AVR Studio.

Since I can now move the servo from the computer, I can also check how well the camera goes on the servo. Realized I can just tape the flat bottom of the webcam to the servo flange, at least as a basic method. Then I moved it around. Works fine, except the servo needs to be taped down too, and the cord on the webcam is a mini-issue.  I think I can just get some double-sided poster tape and have a nice solid connection for now, and tape on a strain relief for the cord.

No comments:

Post a Comment