Go to Post Leave it to CD to misconstrue a joke this badly. - connor.worley [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 19-05-2005, 07:58
John Gutmann John Gutmann is offline
I'm right here
AKA: sparksandtabs
FRC #0340 (GRR)
Team Role: Mechanical
 
Join Date: Feb 2005
Rookie Year: 2004
Location: rochester
Posts: 804
John Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant futureJohn Gutmann has a brilliant future
Send a message via AIM to John Gutmann Send a message via MSN to John Gutmann Send a message via Yahoo to John Gutmann
PBASIC operator interface LED problems

on the operator interface there are the LEDs for the pwm's and the relay's, they al work but just not how they are supposed to, i loaded up the basic code and from what i understand for pwm 1 when the joystick is all they way forward the green LED should be on and when the joystick is all the way back the red LED should be on, and when the joystick is centered both should be on, and the same with the pwm2 and its corrosponding joystcik, but this doesn't happen the LEDs all just randomly blink
  #2   Spotlight this post!  
Unread 19-05-2005, 10:39
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,856
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: PBASIC operator interface LED problems

Your joysticks are plugged into OI ports 1 & 2?

Your joystick may not be giving you full range and falling into the ranges set in the default code for the OI LEDs.
You can try expanding the ranges to be any forward and any reverse value rather than only the top/bottom of the normal range. You might also like to increase the range where both lights are on.
This is the way the default code is now for OI Port 1:
Code:
select (p1_y) 'Check position of Port 1 Joystick
	case 0 to 56 'Joystick is in full reverse position
		Out8 = 0 ' Turn PWM1 green LED - OFF
		Out9 = 1 ' Turn PWM1 red LED - ON 
	case 125 to 129 'Joystick is in neutral position
		Out8 = 1 ' Turn PWM1 Green LED - ON
		Out9 = 1 ' Turn PWM1 red LED - ON 
	case 216 to 255 'Joystick is in full forward position
		Out8 = 1 ' Turn PWM1 Green LED - ON 
		Out9 = 0 ' Turn PWM1 red LED - OFF
	case else 'In either forward or reverse position
		Out8 = 0 ' Turn PWM1 green LED - OFF
		Out9 = 0 ' Turn PWM1 red LED - OFF
endselect

Try changing the ranges to:
Code:
select (p1_y) 'Check position of Port 1 Joystick
	case 0 to 124 'Joystick is in full reverse position
		Out8 = 0 ' Turn PWM1 green LED - OFF
		Out9 = 1 ' Turn PWM1 red LED - ON 
	case 125 to 129 'Joystick is in neutral position
		Out8 = 1 ' Turn PWM1 Green LED - ON
		Out9 = 1 ' Turn PWM1 red LED - ON 
	case 130 to 255 'Joystick is in full forward position
		Out8 = 1 ' Turn PWM1 Green LED - ON 
		Out9 = 0 ' Turn PWM1 red LED - OFF
	case else 'In either forward or reverse position (unused)
		Out8 = 0 ' Turn PWM1 green LED - OFF
		Out9 = 0 ' Turn PWM1 red LED - OFF
endselect

Do the same for OI Port 2.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 19-05-2005 at 10:50.
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
Making a beacon indicator LED burn its brightest without burning out DanL Electrical 7 26-01-2004 08:05
Help On Coding 2K1 Controller GregTheGreat Programming 9 05-12-2003 18:35
Any problems with PBASIC 2.5 Editor v2.0 Carl Owenby Programming 7 10-02-2003 10:00
Rookie Programmer has question about the default code DanL Programming 3 26-01-2002 19:59


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

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