Go to Post IMO, everyone should experience at least one Battlecry. - Dan Petrovic [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Spotlight this post!  
Unread 17-02-2008, 13:47
RyanW RyanW is offline
Registered User
FRC #0449 (Blair Robot Project)
Team Role: Programmer
 
Join Date: Feb 2007
Rookie Year: 2007
Location: MD
Posts: 40
RyanW has a spectacular aura aboutRyanW has a spectacular aura about
Re: IR button coding rules

Well, first of all, pwm03 is going to be 127 no matter what counter1 is. You set it to 200, and then immediately to 127 in the same method. It's either going to stall back and forth for 15 loops (if you're using something like WPILIB which calls GetData and PutData in the middle of your routines) or else just stay at 127.

Beyond that,
If you're using rc_dig_in08 to 11 as your IR buttons, this isn't legal. Any individual IR command should only make reference to one of the buttons, UNLESS you use combinations of buttons to minimize interference, and still send EXACTLY four commands. So you need to move if(rc_dig_in09==1&&rc_dig_in10==1) out of your else if.

You're allowed to use timers in your command - you're allowed to use pretty much whatever you want in your command - BUT it has to be internal to the command, or else directly based on sensor inputs from the robot. So if you tell it "Drive straight", and it sees that there's a wall, it can stop based on that information. Your counters are fine as long as they're initialized in the same IR command.
 


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
Infrared button rules duhoverdrive Programming 1 26-01-2008 14:26
C coding ExarKun666 General Forum 12 21-12-2007 14:13
Photoswitch coding magical hands Programming 0 17-01-2006 21:20
coding a potentiometer incognito_NICK Programming 5 14-02-2005 15:56
Coding conventions Anthony Kesich Programming 20 08-01-2004 10:50


All times are GMT -5. The time now is 20:25.

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