My team is not finished yet but it seems you guys could help me out, how do i program my robot to have a motor spin counter clockwise when i pull the trigger on the joystick, then released it stops turning the motor, and when i press the thumb button i want the motor to spin clockwise. I am using easyc and i was wondering how to write that code. Please help.

Done???? What does this word mean? In FIRST, no robot is "done" until at least after the last competition of the year (offseason or otherwise). And we still aren't done with our '04 bot--it's been used as a practice bot for last year and a sensor testbed this year. (I know of a team that modified their robot in a big way between Championship and IRI last year. 'Nuff said.)

My team is not finished yet but it seems you guys could help me out, how do i program my robot to have a motor spin counter clockwise when i pull the trigger on the joystick, then released it stops turning the motor, and when i press the thumb button i want the motor to spin clockwise. I am using easyc and i was wondering how to write that code. Please help.

search in the easy-c section of the programming forum. if it's not there, post

My team is not finished yet but it seems you guys could help me out, how do i program my robot to have a motor spin counter clockwise when i pull the trigger on the joystick, then released it stops turning the motor, and when i press the thumb button i want the motor to spin clockwise. I am using easyc and i was wondering how to write that code. Please help.

if(p1_sw_trig==1)
pwm01=0;
else if(p1_sw_trig==0)
pwm01=127;

if(p1_sw_top==1)
pwm01=255;
else if(p1_sw_top==0)
pwm01=127;

This is how you would do it in mplab...not sure if it will work in easy c.

The "p1's" in the "if's" are dependent on what port your joystick is plugged into in the OI. If your joystick is plugged into port 2- change it to p2_sw_trig.

Also...the ""pwm01" should be changed to whatever pwm your motor is connected to. You should also check if the thumb button is p1_sw_top...it could also be p1_sw_aux1 or p1_sw_aux2.

When we mean finished, we mean "it's working in full, functional form," not "let's sell this as the next GM hybrid." And by the first definition, we're shooting for a completely-constructed bot by Thursday (and it gives me time to work on my other duties: awards.)

I understand what you are saying, however i am not building it in MPLAB, if i was to build it there is there a defualt code that already is programmed to drive the bot. In easyc i need to know what to drag and drop into the code(pwm control, OI to Digital output, OI to analog, and that whole list) what i would drag and drop.

We've got our priorities backwards; we have several of the harder aspects done to the point where they work decently well, but the "easier" things we have yet to finish. Now we're trying to get it to the point where we can have our drive team start playing with it to figure out what needs to be changed. We're way behind where we were this time last year, but that's because we're pushing our limits a lot more this year. I just hope it can move before ship date...

__________________

Proud alum of FRC Team 1629 and mentor of FRC Team 639Cornell Engineering class of 2012!!

We've already been informed by our mechanical group today that with how things are going building wise, we'll have ~3 days to actually test code. No finished robots anytime soon at our school.

We have most (or all) of the chassis built, the problem is electrical is way behind (all new people and difficulty in getting engineers in to help put us there), and they still have to finish alot of the "extra" parts that go on the chassis.

Programming we've managed to jump from no code to almost all manual control done in only 3 days.

I've learned never to say never when it comes to FIRST teams. Frankly, I guarantee you that at least one team is done at this point.

That's correct. But I do not speak of team 25. Or do I...

__________________

-= Bharat Nain =-

Whatever you do, you need courage. Whatever course you decide upon, there is always someone to tell you that you are wrong. There are always difficulties arising that tempt you to believe your critics are right. To map out a course of action and follow it to an end requires some of the same courage that a soldier needs. Peace has its victories, but it takes brave men and women to win them. - Ralph Waldo Emerson

We've already been informed by our mechanical group today that with how things are going building wise, we'll have ~3 days to actually test code. No finished robots anytime soon at our school.

3 days? That's 72 hours of pure testing! Luxury!

Two years ago, our team didn't finish our bot until the last hour of pit day (that's not really legal anymore), and we spent entirely too much time creatively shedding weight in the pits. So, as you might imagine, the code wasn't, err, optimal. Last year we had plenty of time with the kitbot, but the final bot wasn't really ready until ship day (with some substantial changes), so it was again a lot of pit engineering getting the code up to snuff.

That said, our team this year seems to be in good shape, especially with respect to the building, and the software is coming along nicely with incremental features added. This year's bot will never be "done", it will just keep getting better and better.