View Single Post
  #3   Spotlight this post!  
Unread 09-12-2004, 15:54
stephenthe1 stephenthe1 is offline
Registered User
#1008
 
Join Date: Dec 2004
Location: Ohio
Posts: 113
stephenthe1 is on a distinguished road
Re: encoder vs. motor

can you look at this and tell me if you see any errors.

Code:
	//the encoder is at 50 resolution
	//the arm motor is attatched to pwm_02
	//the encoder is attatched to rc_dig_in06
	unsigned int encoder;
	if (p2_sw_trig == 1)
	pwm_02 = 220;
	if (rc_dig_in06 == 1)
	encoder = encoder + 1;
	if (encoder == 11)
	pwm_02 = 128;