Go to Post This will likely fall on deaf eyes but - - JaneYoung [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
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
  #16   Spotlight this post!  
Unread 20-12-2004, 16:43
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,931
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: Rookie help

Variable declarations must be at the very beginning of a routine. I noted that above in an edit after my original post. Sorry about that.
Quote:
Originally Posted by doyler
Code:
/*******************************************************************************
* FUNCTION NAME: Process_Data_From_Master_uP
* PURPOSE: Executes every 17ms when it gets new data from the master 
* microprocessor.
* CALLED FROM: main.c
* ARGUMENTS: none
* RETURNS: void
*******************************************************************************/
void Process_Data_From_Master_uP(void)
{
static unsigned char servo1=0;
static unsigned char counter=0;
Getdata(&rxdata); /* Get fresh data from the master microprocessor. */
 
Default_Routine(); /* Optional. See below. */
 
/* Add your own code here. */
 
if (counter < 20) // about one 1/3 second in the slow loop
counter++;
else
{
counter = 0;
if (servo1 < 255)
	 servo1++; // servo1 will slowly step through each of it’s positions
else
	 servo1 = 0; // servo1 will quickly reset to the zero position
}
pwm03 = servo1;
 
printf("PWM OUT 7 = %d, PWM OUT 8 = %d\n",(int)pwm07,(int)pwm08); /* printf EXAMPLE */
 
Putdata(&txdata); /* DO NOT CHANGE! */
}
(sorry if i am being annoying, im just new at this)
You're not annoying. I like to help you get started.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 21-12-2004 at 16:40. Reason: Fixed incorrect comment. Slow loop = 59/sec in EDU 38 in FRC
 


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
Rookie 2005 Nats Qualification? Alexander McGee Championship Event 2 27-10-2004 10:14
Senior Project 05: Mini competition to help fundraise for local rookie teams Alex Cormier Fundraising 0 07-10-2004 15:58
Rookie Regionals rachakate Regional Competitions 5 24-03-2004 00:01
I want to have a rookie nationals! Tton Championship Event 5 23-04-2003 14:46


All times are GMT -5. The time now is 16:55.

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