Go to Post You can either spend lots of energy complaining about it and whining or you can try to figure out how to make a positive experience from the whole thing. - dlavery [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 16-02-2008, 17:40
Shivang1923 Shivang1923 is offline
I make robot go VROOM VROOM!
FRC #1923 (MidKnight Inventors)
Team Role: Programmer
 
Join Date: Feb 2008
Rookie Year: 2008
Location: West Windsor, NJ
Posts: 38
Shivang1923 has a spectacular aura aboutShivang1923 has a spectacular aura about
Re: Programing IR board problem

The variable is static, and initialized to zero.

Code:
static int counter = 0;
  #2   Spotlight this post!  
Unread 16-02-2008, 18:22
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,695
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Programing IR board problem

Well, the only thing I see (if the "command = 0" line is removed to prevent the endless looping) is that IR command 1 would not work properly if you ever pressed it a second time. That could be fixed a number of ways, e.g., use a toggle to reset counter=0 when the button is pushed a second time.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #3   Spotlight this post!  
Unread 16-02-2008, 20:27
Shivang1923 Shivang1923 is offline
I make robot go VROOM VROOM!
FRC #1923 (MidKnight Inventors)
Team Role: Programmer
 
Join Date: Feb 2008
Rookie Year: 2008
Location: West Windsor, NJ
Posts: 38
Shivang1923 has a spectacular aura aboutShivang1923 has a spectacular aura about
Re: Programing IR board problem

so i would do this?

Code:
case 1:
                counter = 0;
		if (counter <= 50)
		{
			pwm01 = pwm02 = 255;
			counter++;
		}
		else
		{
			pwm01 = pwm02 = 127;
		}
	    break;
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
IR board problem AmitCarmeli Electrical 3 09-02-2008 18:53
Another IR Board Problem C222 Electrical 2 13-01-2008 17:36
Do you have a problem with the IR Board? DonRotolo Control System 5 07-01-2008 23:57
Lights in Joystick board or control board rcubes85 Control System 15 26-02-2005 23:40
Perf Board = BS2-IC Carrier Board? indieFan Electrical 2 16-09-2004 08:28


All times are GMT -5. The time now is 07:35.

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