Go to Post I got something totally different from my FIRST experience. to me the spirit of FIRST is all about sharing. during the 6 week build period, you share yourself with the other people on your team. at the competition, you share your creation with everyone who watches your 'bot play the game. - George1902 [more]
Home
Go Back   Chief Delphi > Old Forum Archives > 2000
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 23-06-2002, 22:59
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
programming

Posted by Charles Elwood.

Engineer on team Bees from Morrisstown High School sponsored by IPT.

Posted on 2/2/2000 8:47 PM MST



I have a question. Suppose I have a motor attached to PWM1 and when you push the joystick on Port1 forward, the motor moves clockwise.....okay now suppose I add some code so that when I push the joystick forward the motor will now move in the opposite direction.
Thanks
charles Elwood


__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
  #2   Spotlight this post!  
Unread 23-06-2002, 22:59
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
Re: programming

Posted by Jerry Eckert.

Engineer from Looking for a team in Raleigh, NC sponsored by .

Posted on 2/2/2000 10:22 PM MST


In Reply to: programming posted by Charles Elwood on 2/2/2000 8:47 PM MST:



: I have a question. Suppose I have a motor attached to PWM1 and when you push the joystick on Port1 forward, the motor moves clockwise.....okay now suppose I add some code so that when I push the joystick forward the motor will now move in the opposite direction.
: Thanks
: charles Elwood

pwm1 = 254 - pwm1

__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
  #3   Spotlight this post!  
Unread 23-06-2002, 22:59
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
Programming with solder...

Posted by Joe Johnson.   [PICTURE: SAME | NEW | HELP]


Engineer on team #47, Chief Delphi, from Pontiac Central High School and Delphi Automotive Systems.

Posted on 2/3/2000 4:46 AM MST


In Reply to: Re: programming posted by Jerry Eckert on 2/2/2000 10:22 PM MST:



OR...

You could just reverse the wires going from the Victor to the motor.

Depends on what you want to do. If you want to see code examples that is one thing. If you really just want to reverse the direction of the motor, flipping the wires is easy too.

Joe J.

P.S. You MAY want to put a few more bits of code in the example given in the message by Jerry Eckert, depending on how paranoid you are about problems with PBasic's 16 bit unsigned math.

I would perhaps write it like this:

pwm1 = 254 - (pwm1 max 254)

This will prevent pwm1 from going wacko if it ever happens to be set to 255 going into the conversion. Also, while I am at it, do NOT do this:

pwm1 = (254 - pwm1) min 0

This will not work as desired. In PBasic, NOTHING is less than 0 so the expression 'XXX min 0' ALWAYS returns XXX. Pbasic has some strange ideas when it comes to math...


__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
 


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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming Compatition Angela06 Programming 30 08-04-2005 23:12
multi-bank programming problem GregC Programming 3 14-02-2003 16:13
Pneumatics electrical wiring and programming archiver 2001 1 23-06-2002 23:10
Error found in programming for the pump and pressure switch sjharobotics Programming 4 06-02-2002 17:46
pbasic programming punarhero Programming 4 21-01-2002 23:32


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

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