I'm not positive, but I think this should work. I've never used the IRLink with the RCX in RobotC before.

_________________A.K.A. inxt-generationSelf-proclaimed genius, and future world dominator.My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth DoctorBow down to Nikola Tesla, King of the Geek Gods.

Please note that HTRCXreadResp() is flaky at the best of times and dumps the whole register, so be sure to check more than just rcxmessage[0]. I never got it working reliably as a means to read something from the RCX. The buffer will be overwritten in the sensor whenever something new comes along. It's a real pain in the butt.

Did you try what Xander said and read the whole register? You can use a "for()" loop for that instead of typing out the display command 8 times.

_________________A.K.A. inxt-generationSelf-proclaimed genius, and future world dominator.My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth DoctorBow down to Nikola Tesla, King of the Geek Gods.

Tue May 22, 2012 8:56 am

cheechr1

Rookie

Joined: Sun Jan 23, 2011 3:14 amPosts: 14

Re: Help with Irlink sensor and HTRCXReadResp()

Im sorry im no programming expert, I use Robot C because NXT-G is almost unusable. I really dont know what you mean by "the whole register". Ill show you what I tried..NXT Program:

So far I am finding Robot C to be a great programming environment for the NXT its just when it comes to hex things and registers I become lost. Thanks for all the help and if you can think of any online sources where I could read on this a bit more I would be most grateful. Thanks again!

Note: I am using Robot C 3.08 for the NXT and 2.03 for the RCX

Tue May 22, 2012 1:20 pm

elibm

Rookie

Joined: Sun May 26, 2013 4:52 pmPosts: 2

Re: Help with Irlink sensor and HTRCXReadResp()

Hi ,following Xander indications,I managed to send some commands from my RCX 2.0 to my NXT using the IRLink sensor.I receive garbage on the NXT most of the times.Then How can we know when the NXT has received the right data, and when can we read it ??Well, I found a pattern that helps me to filter the data received by the NXT. Here is the code.

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum