Go to Post The world has never seen a group of people who have taken such interest and delight in being rickrolled. - StevenB [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
  #9   Spotlight this post!  
Unread 10-02-2004, 10:59
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: Mapping Buttons to PWMs

Quote:
Originally Posted by Joe Ross
If you want to skip the if statement, you can use the following code

pwm03 = 127 + 63 * p1_sw_trig;

If you want your motor to be able to go backwards also, you can use 2 switches with the following code.

pwm03 = 127 + (63 * p1_sw_trig) - (63 * p1_sw_top);
just a cautionary real-world note, although this may work for the FRC, in actual C, the value of "true" for booleans is not always 1 - in fact, it's often -1.

but yes, for the FRC, one could use Joe's code.
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
 


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
Shortcut buttons when posting Wetzel CD Forum Support 2 10-12-2003 15:27
Looking for some help with buttons and pins... Amanda Morrison General Forum 4 26-02-2003 17:32
Assigning Joystick buttons.... archiver 2001 5 24-06-2002 00:59
Where do the stop buttons go??? archiver 2001 0 24-06-2002 00:35
How many buttons??? purplehaze357 Championship Event 0 18-04-2002 23:54


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

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