Go to Post At every event I've seen this year, there has been at least one robot that left a part on the field. Even some of the robots have decided they don't want to play and this year and made a break for it in autonomous! :yikes: - ctt956 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 24-01-2006, 18:11
Erics626's Avatar
Erics626 Erics626 is offline
Cool, Calm, Collected
None #1018 (Robodevils)
Team Role: Electrical
 
Join Date: Jan 2003
Rookie Year: 2001
Location: Pike High School, Indianapolis, Ind
Posts: 69
Erics626 is a jewel in the roughErics626 is a jewel in the roughErics626 is a jewel in the rough
Send a message via AIM to Erics626
Shifting with easyC

OK so here's my problem. Hopefully I explain to the best I can. We want to be able to shift our Dewalt transmissions attached to the CIM motors. We have a servo attached to the shifting plate of the transmission, and when the servo rotates, it shifts gear. Our default gear is second, and we have the servo set up so it is second gear at 127. We want the trigger button to up shift, and the thumb button to downshift. Our problem is that the transmission only switches gear when the trigger or thumb button are depressed. We want it so that when a trigger or thumb button is hit, it shifts gear and you do not have to hold the button down. Is there anyway to fix this. Any help would be appreciated. My email address is greendblink182@hotmail.com
__________________
Championship Finalist - 2006 Buckeye Regional (Thanks 461 and 141!)
Fourth Year FIRST Member
Third Year Electrical Team Leader
First Year BEST and FIRST Robotics Team Co-Leader
Second Place - Robotics Competition, 2005 Bearcat BEST
Second Place - BEST Competition, 2005 Bearcat BEST
Most Photogenic - 2005 Bearcat BEST
Most Robust - 2005 Bearcat BEST
Fourth Place - Robotics Competion, 2005 Nationals(South's BEST)
"Get your philosophy from a bumber sticker."-Billie Joe Armstrong
  #2   Spotlight this post!  
Unread 24-01-2006, 18:58
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,648
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
Re: Shifting with easyC

Quote:
Originally Posted by Erics626
OK so here's my problem. Hopefully I explain to the best I can. We want to be able to shift our Dewalt transmissions attached to the CIM motors. We have a servo attached to the shifting plate of the transmission, and when the servo rotates, it shifts gear. Our default gear is second, and we have the servo set up so it is second gear at 127. We want the trigger button to up shift, and the thumb button to downshift. Our problem is that the transmission only switches gear when the trigger or thumb button are depressed. We want it so that when a trigger or thumb button is hit, it shifts gear and you do not have to hold the button down. Is there anyway to fix this. Any help would be appreciated. My email address is greendblink182@hotmail.com
I almost always have my switches work via edges not via states.

For example rather than:
If (switch==1) then PWMout = XXX else PWMout = YYY

I do this:
If (switchNow==1 and switchOld==0) then PWMout=XXX
Elseif (switchNow==0 and switchOld==1) then PWMout=YYY

The second case allows you to have other conditions change the state of the PWMout.

If you do things this way, what you want to do becomes trivial:
If (switchNow==1 and switchOld==0 and PWMout=XXX) then PWMout=YYY
Elseif (switchNow==1 and switchOld==0 and PWMout=YYY) then PWMout= XXX

The above pseudo code will allow you to use your switch to toggle between XXX & YYY states.

There are probably better ways to do this but I hope this will give you some idea of how it can be done.

Joe J.
__________________
Joseph M. Johnson, Ph.D., P.E.
Mentor
Team #88, TJ2
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EasyC Wish List dcbrown Programming 32 14-08-2006 09:24
EasyC v2.0 is mandatory for FVC! skimoose FIRST Tech Challenge 7 14-01-2006 18:37
Kickoff easyC workshop integrated into EasyC help file Dan Larochelle Programming 0 11-01-2006 06:12
Is a shifting transmission really necessary? Jay TenBrink Technical Discussion 78 02-08-2005 09:21


All times are GMT -5. The time now is 18:38.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi