Go to Post I hope you realize that by starting this thread you have earned yourself a permanent place at the "WOEWITWISTFT" ("What On Earth Was I Thinking When I Started THAT FIRST Trend?") table. It's members are few, but the conversation is the most honest and amusing in the entire place. ;) - Jessica Boucher [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 08-02-2005, 21:43
Calvin Calvin is offline
Registered User
no team
 
Join Date: Feb 2005
Location: Portland OR
Posts: 105
Calvin has a spectacular aura aboutCalvin has a spectacular aura about
Question Negative numbers?

Taking in the input as p1_y, and output as pwn01... I'm having some problems.

When the joystick is moved the the direction of "128 - 254" it works, yet when "126 - 0" it starts of to work (motor turning) but then full blast turns the other direction. I do not understand what might be the problem. The Code worked fine in the RoboEmu.

Here is a part of the code
Code:
if (p1_y > 127) // This part works
{
pwm01 = (0.007874015748031496062992125984252) * (p1_y - 127) * (p1_y - 127) + 127;
}

else // Does not work
{
pwm01 = (-0.007874015748031496062992125984252) * (p1_y - 127) * (p1_y - 127) + 127;
}
The only differenece it that the 2nd part has " (-0.00787..." a negative number.
Is that the Problem? If not, what am I doing wrong?
 


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
Field Elements errors in part numbers Mike Martus Kit & Additional Hardware 0 08-01-2005 19:05
Pneumatic Part Numbers CyberWolf_22 Pneumatics 3 01-10-2004 11:19
A couple of noodle scratchers Cheese Head Programming 11 07-12-2002 09:59
Even more interesting numbers: Division of regional winners archiver 2001 8 24-06-2002 03:10
More interesting numbers...specific to big-ball matches archiver 2001 13 24-06-2002 02:51


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

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