Monday, December 24, 2007

Difficult Problems Sometimes Have Simple Causes!

Or the other way around. Had to figure out quite a bit but now it looked like it was clear sailing. All I needed to do to finish with the bluetooth was have it work with the Monski Pong. Well for some reason it did not work. When I ran it the Processing program locked things up and the window for playing Pong locks up and stays blank. This is the same program I ran that worked through the USB cable to the Arduino. After this I could not communicate with BlueSMiRF through hyperterminal until I turned the BlueSMiRF off and on.

I went through variations of this numerous times. The Arduino Alpha 010 utility also would not view serial data in the serial monitor throught the bluetooth. This is likely unrelated to the Monsky Pong not working though it was not clear earlier. I also tried to upload the Arduino program though the bluetooth COM but it didn't work either. I imagine it should be possible.

I even had to unplug and plug in again the usb bluetooth dongle one time. This is after restarting the system and turning off and on the BlueSMiRF several times without the problem clearing up. I realized that during the restart system cycle the usb ports still get power. This happened only once and I was trying all kinds of crazy things and don't remember what I did that particular time. The error on the pc was that it would not connect and gave the error message "There was a security error. You may need to redo pairing." or some close phrasing.

I was using the correct COM port, the same ones I have been using all along in hyperterminal.

At times like this I find it helpful to go back to a state where things were working and go over everything in order of what seems most likely to be at fault. If anything I was sure the hardware was not broken, and only cutting out because I ran the processing program. I finally went over the serial commands in the processing program and found that I had somehow deleted or not put in the baud statement in:

myPort = new Serial(this, Serial.list()[1], 9600);

For lack of 9600 I spent a couple hours going over everything!

It works now. Though I am not quite sure that this is what really fixed things.

A couple of observations. The Monski Pong takes longer to open the play window when using the bluetooth vs. the usb cable to the arduino. I think it must be the time to establish the serial connection through bluetooth. Another thing is that the analog input from the pots and flex sensor is "jittery" the values oscillate and it makes the paddles in monski pong jitter up and down.

On to the next project!

No comments: