Random header image... Refresh for more!

Achievement Unlocked: Wild Goose Chase

So, I found out why it wasn’t waiting…

It was waiting and I’m just a moron.

I had my program set up to send a Bluetooth message to the NXT to retrieve the contents of Mailbox 10.  One the NXT, I was writing true to Mailbox 10 when I started an action and false when the action completed, so that Mailbox 10 could be used as a “Busy” signal.  My program would poll until Mailbox 10 reported false, then continue.

Thing is, I was sending the “Clear Mailbox” flag to the NXT.  So the NXT gave me the contents of Mailbox 10, then cleared Mailbox 10.  The first read returned true, because the motor was busy.  The second read returned false, not because the action had completed, but beacuse the “Clear Mailbox” flag caused Mailbox 10 to be filled with a bunch of zeroes.

0 comments

There are no comments yet...

Kick things off by filling out the form below.

Leave a Comment