Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
PWM Question

 
Post new topic   Reply to topic    Forum Index -> ZX-40
Author Message
rich_mays



Joined: 07 Mar 2007
Posts: 4

Posted: 24 April 2007, 14:06 PM    Post subject: PWM Question Reply with quote

I tried running the example in the ZBASIC manual for the PWM function. After verifying that the pulse train should drive a servo, I ran the program, but got no response from the servo. I changed the duty cycle parameter from a Single to an Integer, using the same percent values, and the servo worked fine.

Has anyone else run into this? Is there additional setup required when using the PWM(Byte, Single) overload of the function?

Thanks,
Rich
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2493
Location: Portland, OR

Posted: 24 April 2007, 14:57 PM    Post subject: Re: PWM Question Reply with quote

rich_mays wrote:
Has anyone else run into this? Is there additional setup required when using the PWM(Byte, Single) overload of the function?


We were able to reproduce the problem that you identified - it is an error in the code generator portion of the compiler. You can work around the problem temporarily using code like that below:

Code:
Dim duty as Single
duty = 50.0
Call PWM(chan, duty)
Back to top
rich_mays



Joined: 07 Mar 2007
Posts: 4

Posted: 24 April 2007, 18:46 PM    Post subject: Reply with quote

Thanks for the quick response!
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZX-40 Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group