View Single Post
  #5   Spotlight this post!  
Unread 30-01-2006, 07:24
Daniel_LaFleur's Avatar
Daniel_LaFleur Daniel_LaFleur is offline
Mad Scientist
AKA: Me
FRC #2040 (DERT)
Team Role: Engineer
 
Join Date: Apr 2005
Rookie Year: 2003
Location: Peoria, IL
Posts: 1,959
Daniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond repute
Send a message via MSN to Daniel_LaFleur
Re: Who has a finished robot?

Quote:
Originally Posted by David55
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.

Please tell me if I confused you and I will try to make it simpler.
I would not use '0' or '255' as PWM #s. Use '1' and '254'. two '255's in a row indicate end of packet and can cause some erratic behavior.

I havent looked at easy C but you should be able to look at the code behind each icon and edit it, thus the code above should be useable.

Good luck.
Reply With Quote