So I was trying to figure out how to add more motors into a EZ template on top of PROS, like for a intake, but I am not sure how to do this. It seems simple but I can’t figure it out. Thanks.
Ez template is designed to help you with hard things like PID controllers and auton selectors but if you wan to add more simple functionality you will have to make it your self.
I would suggest looking at the pros wiki as they have a great introductory series based on a claw bot.
Programming the Clawbot — PROS for V5 3.8.0 documentation (purdue.edu)
To control your intake you would want something like this;
if (master.get_digital(DIGITAL_R1))
{
intake = 127;
}
else if (master.get_digital(DIGITAL_R2))
{
intake = -127;
}
else
{
intake = 0;
}
Hope this helps.
i think he was asking how to initialize / defining more motors and where to do it. not how to code it
This extra functionality for PID loops on intakes and other mechanisms was only just added to the EZ template. At the time EZ template was only to help with PID loops for the drivetrain.
Hope this clears things up.
The most simple way is
pros::Motor cataMotor(1);
I just have one question. where would I put the code to set up motors and pistons in EZ template. Is it just in the main.cpp file?
the main.cpp file should work, yes.
Sorry to post in this dead discussion, but how would you add in triport features like a digital out?