autonomous help

we have a competition tomorrow and need autonomous help. our program is supposed to keep our fly wheel on the whole 15 seconds. however every 3 seconds our intake feeds a ball. then it turns off for 3 seconds. then repeats. I have no clue how to do this and no clue how to upload our program. can someone make a demonstration of this for me?

Can you post your code?

how do I do that?

What programming language are you using? RobotC or EasyC?

As for how to upload your program, are you talking about physically loading it onto your robot or using it during competition?

Go in the code, copy all the text, then go to create a reply, click on the “</>” icon in the top right of the box. Paste the code in between the CODE tags.

If you’re using EasyC you can try just clicking the “Attach a File” in the bottom left and attach the file for the code to your post.

I’m using easy c
and i mean uploading it to where you can see it.

ok so i switched computers and i have the program in front of e but not on this computer. all it is is (in a while loop) turn on flywheel.(end wile loop) wait 3 seconds (start while loop) start intake wait 3 seconds stop intake. (end while loop) repeat x2

Well, looks like I’m a bit late to help with this…oh well.

For the record, you don’t have to use while loops in order to get your functions running. This is probably what is messing up your program since the program never leaves the first while loop that starts the flywheels spinning.

If you want for your program to work, removing the while loops should probably do the trick. For example:

Instead of:

motor[flywheel] = 127;
while(true)//repeat twice
motor[Intake] = 127;
motor[Intake] = 0;

Use this:

motor[flywheel] = 127;
motor[intake] = 127;//repeat this part 2 more times
motor[intake] = 0;

I wrote it in RobotC format for my own convenience but it should be relatively easy to translate what I wrote into EasyC blocks. Obviously, this isn’t the most optimal way to write an autonomous(start looking into functions) but it should suffice for what you want to accomplish.

so just don’t add the stop for the flywheel?

Since this is in autonomous mode, you probably don’t want to turn off your flywheel and waste time getting it back up to speed. And for the record, you never stop the flywheel in the original code either.

Just make sure that you remove those while loops since the rest of your program will never be reached.

so the original code was fine just remove the while loops?

No, I’m just telling you why your original code wouldn’t work.

If you use the code located at the bottom of my post, it should probably work. Just make sure to adjust for the number of motors you’re using on your flywheel and intake.

ahh got it thanks!