![]() |
easyC trouble
Is there anyway to execute multiple if statements, while statements, or user functions that I wrote at the same time?
|
Re: easyC trouble
Is there anyone out there that would be willing to visit with us on the phone, we are having trouble getting easyc started. If you are interested in this you could email me with your number. My email address is dayle.haaland@k12.sd.us.
Thanks for any help. |
Re: easyC trouble
Quote:
|
Re: easyC trouble
Perhaps I should be more specific. We are trying to write a program for count wheel rotations. We want the left wheel to travel a different number of rotations than the right wheel. I created two different user functions, one for counting the left wheel and one for counting the right wheel. We implemented these functions into autonomous, but the wheels do not start at the same time. Instead, the left wheel goes the distance we set, and as soon as the left wheel is done, the right wheel begins to rotate and start its count.
|
Re: easyC trouble
You will need to combine the counting code for both wheels into a single user funtion or loop.
Also, this thread should probably go in the EasyC for FRC sub-forum |
Re: easyC trouble
Quote:
That way the wheels will both be running at the same time and they will each stop independently after the correct number of rotations. |
Re: easyC trouble
Quote:
|
Re: easyC trouble
Quote:
|
Re: easyC trouble
Quote:
The default code is there, but it's built-in. You just write programs that operate the robot and don't need to look at anything else. You can literally write 10 line (block) programs that drive using the gyro or camera for control. Check out the tutorials in EasyC to get an idea of where to start. If you are still having trouble - send me email and we can talk off-line. |
Re: easyC trouble
ok i've got my robot to drive and turn, using easyc to write the code, however i have another motor that i want to be able to turn on by pressing the trigger button on the joystick how do i write code for that, and that will turn the motor counter clockwise then if i release the trigger i want the motor to stop then if i press the thumb button the motor will turn clockwise, can someone give me detailed instructions.
|
Re: easyC trouble
Quote:
To read the trigger inputs, use the "Digital OI Input" block. It returns a 1 or a 0 depending on the state of the trigger. You can check that value and then decide whether or not to drive the motor. To operate the motor, use the "PWM Control" block. It takes a PWM port number and a speed. |
| All times are GMT -5. The time now is 14:54. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi