Go to Post The magic in a competition isn't finding creative ways to make an opponent lose, but finding even more creative ways for you to win. - galewind [more]
Home
Go Back   Chief Delphi > Old Forum Archives > 2001
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 24-06-2002, 00:38
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: Limiting PWM in pbasic

Posted by Matt Leese at 2/11/2001 1:59 PM EST


Other on team #73, Tigerbolt, from Edison Technical HS and Alstom & Fiber Technologies & RIT.


In Reply to: Limiting PWM in pbasic
Posted by Alan Federman on 2/11/2001 9:59 AM EST:



Well, you need to remember that PBasic doesn't support
floating point numbers. It only does integer math so
multiplying times .25 (if it even compiles) won't ever
do what you want. Dividing by 4 (or better yet, right
shifting two places) will work. This however just
scales down the output value. By using a MAX and MIN
you put a fixed limit and the slope of the input is the
same. When you scale down you change the slope of the
data. When scaling, be careful with being greater than
127 or less than 127 as PBasic also doesn't support
negative numbers so that will definatley give you bad
data. So for stricked limiting of values MAX and MIN
is better but if you want to slow down the robot
totally, scaling works better.

Matt


__________________
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
pwm 13-15 wayne 05 Programming 2 04-10-2003 12:08
PWM and burning out motors patrickrd Technical Discussion 7 19-06-2003 15:30
Obscure PBASIC for RoboEmu rbayer Programming 1 28-03-2003 23:57
PBASIC access to 1 pin only diego25 Programming 13 21-01-2002 10:55
Building a control system Katie Reynolds Technical Discussion 3 16-11-2001 09:34


All times are GMT -5. The time now is 16:13.

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