Lego RCX encoder
I am a new MRS user, the only robot I have is the Lego RCX 2.0. I have figured out the basics (contact sensor, turning on a motor, simple programming logic). I am trying to read my RCX encoder (I always called it a rotation sensor or angle sensor). Does anyone have a sample program using the RCX encoder? My program is running, but when I try to display a text value for the TickCounter, it comes up 0 every time.
Patrick Roberts
Hello Patrick,
The RCX sample service does not actually implement the rotation sensor or encoder. Since the source code is provided, our hope is that the RCX community might pick up this sample and extend it.
Please post back if you are inclined to do this, or if you run across someone who has extended this service already.
Dave
Thank you for the answer! I wasted several hours trying to make this work!
Unfortunately, I have no idea how to implement the service. Do you have some information on this to get me started?
thanks again,
patrick
Hi Patrick. Sorry, but I have not worked with the RCX Ghost api. This would require both C++ and C# changes to the provided samples.
The first step would be to identify the correct API to call to retrieve the encoder values (if there is one). Second would be to update the RCX20Wrapper C++ sample to retrieve these values, and finally, add a notification in the Rxc20 MSRS service to send out notifications when the encoder values are updated.
Dave