Go to Post If they don't treat Dave nicely, he may just keep his big red ball, and not share with rest of us. - Barry Bonzack [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
  #1   Spotlight this post!  
Unread 12-01-2005, 15:07
stephenthe1 stephenthe1 is offline
Registered User
#1008
 
Join Date: Dec 2004
Location: Ohio
Posts: 113
stephenthe1 is on a distinguished road
Question encoders

I'm posting this in hope that someone who has actually registered on this site will post something. there are so many people viewing this, but not posting anything. with that said, I thought this would be a nice place for people to discuss encoders. of course, my main motivation is that these things have been my killing me over the past month. I have tried numerous things, and I can never seem to get it to work. Coding, for the most part, I don't think is a problem. I'm using 2004's code written by Mr. Watson that supports encoders and interrupts. I have everything configured, the only thing that could possible be keeping the encoder from working is my code in User_Routines_Fast.c
what the code does is this, when the third joystick is pushed forward, the arm on last year's robot goes up untill the encoder has "clicked" 12 times. then the motor on the arm is set to neutral. it's as simple as that. (for testing purposes).

Code:
	static long lec = 0;            //lec = encoder count
	lec = lec + Get_Left_Encoder_Count();     //add previous count
      //plus the new count
//the static long is supposed to hold the value every loop                                                               
	if (lec >= 12)
	{
	pwm02 = 127;		//set it to neutral
	}
	else
	{
	pwm02 = p3_y;
	}
can you please tell me why this won't work, or if you think it should. please tell me yourself and don't refer me to somewhere. I've spent so much time, and a simple few lines of code would help me to understand this almost completely. (don't forget, Mr. Watson's 2004 encoder code is what I'm using.)

HELP!!!
thanks,
Stephen

Last edited by stephenthe1 : 12-01-2005 at 15:09.
 


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
Mechanical Wheel Encoders? Jaine Perotti Electrical 15 04-12-2004 22:46
Shaft Encoders wun Programming 3 12-10-2004 16:40
encoders? what kind and where from? ajlapp Electrical 1 03-02-2004 01:49
Who used wheel encoders CyberWolf_22 Technical Discussion 12 04-05-2003 15:37


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

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