For your first problem, are you sure that you have your game board switch set to autonomous? The code seems correct and simple, but the robot needs to know that it is in Autonomous mode and not User control Mode.

For the second part, the line following--This is a general template, and what seems to be the issue is the threshold value isn't working for you. You should adjust the value or better yet, calibrate first and then adjust. These sample programs are written to show you how to do certain things, but there is no guarantee that with your lighting conditions or sensor distance from the ground, that it will work.

Be sure that your light sensor is about half a centimeter from the ground. Also adjust the threshold. If your room is brighter or darker than the test room we wrote this program in, chances are that it wont work.

To calibrate the light sensor (best idea so that it will work regardless of lighting conditions) take a reading on your light surface and take a reading on your dark surface. That way you know exactly what the robot sees with your sensor on your board. Then, a nice and simple way to get a good threshold is to add the value for light to the value for dark, and divide them in half: (lightReading + darkReading) / 2

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