We have been testing Compass examples, none seem to work properly. Either the robot won't move or turn endlessly. Any insights?

Mon Feb 03, 2014 3:04 am

rcahoon

Site Admin

Joined: Tue Oct 09, 2012 10:34 amPosts: 192

Re: Compass instruccion not working

Hi agonzalez,Only very old virtual worlds have robots equipped with compasses. Modern virtual robots instead use gyroscopes to measure turning. All modern virtual worlds also include a screen where you can see all the motors and sensors that are on each robot - check it out to see which sensors you have available to program with.

We are using Operation Reset. The version that is been on the website for the past month.The robot shows a Compass Sensor on Digital Port 5.Even when this VW is old, shouldn't it work? We are using Natural Language and the samples that came with the program.Should I try to change them to gyroscope? Would it take it?

Thanks for your help

Mon Feb 03, 2014 2:15 pm

rcahoon

Site Admin

Joined: Tue Oct 09, 2012 10:34 amPosts: 192

Re: Compass instruccion not working

Just checked, and that was an oversight on our part. Yes, the Operation Reset robots are still using the compass.

Try this updated code. It's the Turning with Compass sample code with two changes: I had to increase the amount of power being sent to the motors, and I had to reverse the rightMotor. We'll make sure these changes are included with the next release of ROBOTC

/*+++++++++++++++++++++++++++++++++++++++++++++| Notes |++++++++++++++++++++++++++++++++++++++++++++++Turning with CompassThis program instructs your robot turn until the desired number of degrees has been reached.There is a two second pause at the beginning of the program.

*To run this sample program on Swervebot, be sure to Reverse Motor Port 3 in the Motors and Sensors Setup, and to make sure that Motor Port 2 is NOT Reversed.----------------------------------------------------------------------------------------------------*/

Who is online

Users browsing this forum: No registered users and 1 guest

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