Friday, May 14, 2010

MARVIN

MARVIN has been coming along nicely. I have been working on him a lot in the last two weeks which is primarily the reason there hasn’t been many posts this week (not to mention the fact that all my resources have been pretty slow this week.

Last week I spent lots of time working on the radar system. I have the math figured out to get him to scan properly. The radar should be able to move back and forth as well as up and down to search using either the ultrasonic sensor or the legacy light sensor. I spent nearly the whole week frustrated because there was a bug in my code that I couldn’t find, but after much searching, I finally found it. About 5 seconds of editing the code and suddenly everything worked correctly. That’s a nice feeling.


This week I have been working on setting up the format for the code and the header files. I am taking a different approach this time. I have one program for each NXT, one specific header file for each program, and one universal header file that all six NXTs pull from. The universal header file contains common procedures to all the files such as display, music and communication. This is pretty handy because before each program had its own header file and there was little in common, so if I wanted to make a change to all four programs, I had to edit and debug four programs. That’s a real pain.

I have also worked out the bugs on the light communication. I am really beginning to appreciate communicating using the light sensors. I am finding that sending a message is slow because it takes about 480 ms to send a message, but it is very consistent and it I don’t have the minor timing variances that are common with Bluetooth. I don’t have to handshake the NXTs so as soon as the program is running, it is ready to send and receive messages which is really, really nice. Not to mention that I have six NXTs that are able to send and receive equally. Right now I have the programs designed to play a sound file after a certain amount of time and the synchronization is remarkable; it sounds like a single speaker, but in fact it is six speakers. I really fought with timing on the previous version.

1 comment:

  1. looking very good, when this is finished it will probably be one off the greatesrt mindstorms mocs ever, i have never seen something on this scale before and am very much looking forward to its copletion

    ReplyDelete