John Hagan

Greenhorn
+ Follow
since Jan 04, 2013
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by John Hagan

Stephan, thanks for pointing out the fact that I had the streams defined in the wrong place. Winston, I had to go back and relearn input and output streams and stream readers. The leading character did not disappear until I eliminated all of the Data input/output streams. Thanks for helping me clean up my code. I post the updated code and output below for your review and comments.

the code from the W7 PC side:


the code for the NXT robot side:

This is the output on the windows console:


Thanks again. --John
11 years ago
Hi,
I am an amateur programmer programming for the Lego NXT robot using Lejos. I say this because some of the methods/classes I am using may be unique to Lejos. I have two programs interacting. The first is on a W7 PC. It runs from the command line in a console. It is called PC_BT_Connect. The second program (BTReceiveTest) is a blue tooth listener running on the robot, which also runs java. I begin by starting the listnener on the robot. Then I start the command line program which seeks out and connects successfully. I enter characters a line at a time and send them via the bluetooth connector. The robot receives them and prints the line to its screen. Then it turns the string around and sends it back to the PC where it is output to the console. This all works fine, but I am picking up a random first character that gets posted to the PC console on the return message. Can you help me find out where this is coming from?



This is the robot listener:



This is the output:



--John
11 years ago