Coder Social home page Coder Social logo

Comments (1)

mlv avatar mlv commented on July 29, 2024

I use PWM.Servo, as in:

Set the servo period to one million uSec (1S), increments of 5us

(necessary for 25us pulse width)
s=RPIO.PWM.Servo(subcycle_time_us=1000000, pulse_incr_us=5)

Set pulse width to 25us

s.set_servo(18, 25)

This is for a 25us pulse once per second.

On Wed, May 6, 2015 at 4:59 AM, withr [email protected] wrote:

In the example of "example4_pwm_lowlevel.py", it said we can add a new
pulse to a subcycle. E.g.:

import RPIO.PWM as PWM

GPIO = 17
CHANNEL = 0

PWM.set_loglevel(PWM.LOG_LEVEL_DEBUG)

PWM.setup()
PWM.init_channel(CHANNEL)
PWM.print_channel(CHANNEL)

PWM.add_channel_pulse(CHANNEL, GPIO, 0, 50)
PWM.add_channel_pulse(CHANNEL, GPIO, 100, 50)

The above code will generate a pulse with two high levels, for each level,
the width is 50*10us, the subcycle should looks like:
--------__,

what if I want change the pulse to --? I don't think we can
use PWM.add_channel_pulse(CHANNEL, GPIO, 50, 50), because I feel that will
create: ------
_, Am I right? how to change the pulse width
smoothly?


Reply to this email directly or view it on GitHub
#60.

from rpio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.