ROBOTC.net forumshttp://www.robotc.net/forums/ Is there a formula for this?http://www.robotc.net/forums/viewtopic.php?f=55&t=3878 Page 1 of 1

 Author: PanthersRage [ Sat Dec 17, 2011 10:47 pm ] Post subject: Is there a formula for this? So, I finnally got the RobotC virtual Worlds up and running properly on a computer. I like the way it works. I can see it being a major tool in the future for programing for competition.But, one thing seems to be the problem. The amount of seconds I have to plug in for the Robot to move across the board seem unrealistic. they also seem incredibly unrealistic for someone doing an auntonomous program (some of the motions of are way over 30 seconds).What do you all thing I can do about this? Is it something wrong with my code? My code is below!Merry Christmas too all! and thanx for all the help!!#pragma config(Hubs, S1, HTMotor, none, none, none)#pragma config(Sensor, S1, , sensorI2CMuxController)#pragma config(Motor, mtr_S1_C1_1, motorD, tmotorNormal, openLoop)#pragma config(Motor, mtr_S1_C1_2, motorE, tmotorNormal, openLoop, reversed)task main(){ { motor[motorD] = 50; // Motor D is run at a power level of 50. motor[motorE] = 50; // Motor E is run at a power level of 50. wait1Msec(26000); // The program waits 26000 milliseconds (26 seconds) before running further code. } { motor[motorD] = 50; // Motor D is run at a power level of 50. motor[motorE] = 0; // Motor E is run at a power level of 50. wait1Msec(25000); // The program waits 25000 milliseconds (25 seconds) before running further code. } { motor[motorD] = 50; // Motor D is run at a power level of 50. motor[motorE] = 50; // Motor E is run at a power level of 50. wait1Msec(88000); // The program waits 88000 milliseconds (88 seconds) before running further code. }}

 Author: Dad and Adam [ Sun Dec 18, 2011 6:45 am ] Post subject: Re: Is there a formula for this? Hello,I am a novice programmer, but have one suggestion.The limit for wait1Msec is 32767 (2 to the 15th power, starting to count with zero the first element). If the limit is exceeded no warning is given when compiling (at least in RobotC for the real world), but an out of range number may do unpredicable things. The last wait1MSec of 88000 may be causing a problem. Suggest using wait10Msec -which gives 10 times the duration of wait1Msec. -So 88000 would become 8800 (well within the 32767 allowed).Merry Christmas,Dave

 Author: PanthersRage [ Sun Dec 18, 2011 6:39 pm ] Post subject: Re: Is there a formula for this? Thank you so much for a responce! I actually didn't know that.But, during the auntonomous part of the game, all of it must be done in thirty seconds. This doesn't seem to change the amount of tame it takes to do what I am asking. (which isn't much).It still takes 90 seconds to move across the field, which is in no way realistic.Any other suggestions?

 Author: magicode [ Sun Dec 18, 2011 6:53 pm ] Post subject: Re: Is there a formula for this? Well, you are running your motors at half power, but it still shouldn't be taking that long. Try running your motors at full power and see what happens.

 Author: RobinShoop [ Mon Dec 19, 2011 6:19 pm ] Post subject: Re: Is there a formula for this? Hi Folks,We found the bug in our code and will be posting a new build that addresses the problem with programming using timing as a control function. Luckily you do get much better results using feedback from sensors. Sorry.There are multiple improvements with the "Operation Reset" programming game that can be downloaded at the www.rvw.robotc.net page. I expect that we will have a new release that takes care of the timing in February.

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