ROBOTC.net forums
http://www.robotc.net/forums/

Labryinth
http://www.robotc.net/forums/viewtopic.php?f=66&t=6186
Page 1 of 1

Author:  Jkiss427 [ Sun Jul 07, 2013 9:09 pm ]
Post subject:  Labryinth

Hi again. When I do my code
Code:
task main()
{
   motor[motorC] = 100;
   motor[motorB] = 100;
   wait1Msec(5000);


   motor[motorC] = -100;
   motor[motorB] = 0;
   wait1Msec(800);

   motor[motorC] = 100;
   motor[motorB] = 100;
   wait1Msec(5000);

   motor[motorC] = -100;
   motor[motorB] = 0;
   wait1Msec(800);

   motor[motorC] = 100;
   motor[motorB] = 100;
   wait1Msec(2000);

   motor[motorC] = -100;
   motor[motorB] = 0;
   wait1Msec(800);

   motor[motorC] = 100;
   motor[motorB] = 100;
   wait1Msec(2000);
}
It goes forward but does not turn. I also tried
Code:
task main()
{
   motor[motorC] = 100;
   motor[motorB] = 100;
   wait1Msec(5000);


   motor[motorC] = -50;
   motor[motorB] = 50;
   wait1Msec(800);

   motor[motorC] = 100;
   motor[motorB] = 100;
   wait1Msec(5000);

   motor[motorC] = -50;
   motor[motorB] = 50;
   wait1Msec(800);

   motor[motorC] = 100;
   motor[motorB] = 100;
   wait1Msec(2000);

   motor[motorC] = -50;
   motor[motorB] = 50;
   wait1Msec(800);

   motor[motorC] = 100;
   motor[motorB] = 100;
   wait1Msec(2000);
}
But it still doesn't turn. What do I do/change?

Author:  rcahoon [ Sun Jul 07, 2013 10:39 pm ]
Post subject:  Re: Labryinth

Hmm, the turning is working for me, so I'm not sure what the problem might be. If you select View>>Preferences>>Highlight Program Execution, it will show you how your program is executing. Does this give you any hints?

Best,
--Ryan

Author:  Jkiss427 [ Thu Jul 11, 2013 8:07 pm ]
Post subject:  Re: Labryinth

rcahoon wrote:
Hmm, the turning is working for me, so I'm not sure what the problem might be. If you select View>>Preferences>>Highlight Program Execution, it will show you how your program is executing. Does this give you any hints?

Best,
--Ryan

No..

Author:  parkway [ Sat Jul 13, 2013 9:37 pm ]
Post subject:  Re: Labryinth

Try breaking down your code some more. I always try to test one or two movements at a time. I pasted your code below, but I commented out everything after the first turn. Try running that code and see what your robot does.

Also, to Ryan's point about highlighting program executing, you can also try stepping through your code to see what your program is doing at certain points: http://www.education.rec.ri.cmu.edu/previews/robot_c_products/teaching_rc_tetrix_preview/variablesfunctions/debugging/debuggingtechniques/videos/debuggingtechniques.html

Code:
task main()
{
   motor[motorC] = 100;
   motor[motorB] = 100;
   wait1Msec(5000);


   motor[motorC] = -100;
   motor[motorB] = 0;
   wait1Msec(800);

 /*  motor[motorC] = 100;
   motor[motorB] = 100;
   wait1Msec(5000);

   motor[motorC] = -100;
   motor[motorB] = 0;
   wait1Msec(800);

   motor[motorC] = 100;
   motor[motorB] = 100;
   wait1Msec(2000);

   motor[motorC] = -100;
   motor[motorB] = 0;
   wait1Msec(800);

   motor[motorC] = 100;
   motor[motorB] = 100;
   wait1Msec(2000);*/
}

Author:  Jkiss427 [ Sun Jul 14, 2013 5:29 pm ]
Post subject:  Re: Labryinth

parkway wrote:
Try breaking down your code some more. I always try to test one or two movements at a time. I pasted your code below, but I commented out everything after the first turn. Try running that code and see what your robot does.

Also, to Ryan's point about highlighting program executing, you can also try stepping through your code to see what your program is doing at certain points: http://www.education.rec.ri.cmu.edu/previews/robot_c_products/teaching_rc_tetrix_preview/variablesfunctions/debugging/debuggingtechniques/videos/debuggingtechniques.html

Code:
task main()
{
   motor[motorC] = 100;
   motor[motorB] = 100;
   wait1Msec(5000);


   motor[motorC] = -100;
   motor[motorB] = 0;
   wait1Msec(800);

 /*  motor[motorC] = 100;
   motor[motorB] = 100;
   wait1Msec(5000);

   motor[motorC] = -100;
   motor[motorB] = 0;
   wait1Msec(800);

   motor[motorC] = 100;
   motor[motorB] = 100;
   wait1Msec(2000);

   motor[motorC] = -100;
   motor[motorB] = 0;
   wait1Msec(800);

   motor[motorC] = 100;
   motor[motorB] = 100;
   wait1Msec(2000);*/
}


For what you are saying... The debugger window does not stay open until after it is done debugging. I have actually 2
questions.. Question 1: How do you make the debugger stay open so that I can control the debugging process? Question 2: Do I use the debugging process on my code or the code in the video? If it is the code in the video.. I cannot find that sample program. And if you could be so kind and direct me to that code.

Thanks,
Jonathan

Author:  parkway [ Sun Jul 14, 2013 9:02 pm ]
Post subject:  Re: Labryinth

Under the Robot tab there is a command to open the debugger window manually, but when you go to step through you won't be able to see your virtual robot. My advice was better served for a physical robot. My mistake. Let's try this: Run the program as I have it, with the bottom part of your code commented out. Compile and download your program. Before you start the program, open up the debugger windows. Go to the Robot tab > debugger windows > motors.

Now run your program . The motors debugger window should tell you what your motor is actually doing. According to the code motors B and C should go at 100 power for 5 seconds. Then, motor C should go to -100 and motor B should go to 0. Watch your program a few times and see if that is what is happening.

Author:  carltoncarney [ Tue Nov 26, 2013 12:13 am ]
Post subject:  Re: Labryinth

Good job i appreciate your work.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/