-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
using pigpio with 4 motors #141
Comments
Hardware PWM is not available on pins 20, 21, 26 or 16. Attempting to call On a Raspberry Pi 4 B, you only have two usable hardware PWM pins, for further details https://forums.raspberrypi.com/viewtopic.php?t=308908#p1848068. The function hardwarePwmWrite can only be used for these two pins. DMA based PWM is available on any GPIO. For DMA based GPIO used the functions pwmFrequency(frequency), pwmRange(range) and pwmWrite(dutyCycle). If something is not functioning correctly, please post a complete but short sample program that can be used to reproduce the problem. |
so you saying that DMA based PWM is available on any GPIO that means i can use the functions pwmFrequency(frequency), pwmRange(range) and pwmWrite(dutyCycle). on pins 20, 21, 26 or 16.? i tryed but there is no Effect on the pins |
Yes.
As already mentioned above, if something is not functioning correctly, please post a complete but short sample program that can be used to reproduce the problem. Also, post a photo of your Raspberry Pi GPIO header where pins 20, 21, 26 and 16 are marked so that I can see them. |
after a lot of seaches i find that i need to make 4 motor work on this (Waveforms to generate GPIO level changes (time accurate to a few µs)) now how can i use waveforms .......... can you plz give me example const pigpio = require('pigpio');
pigpio.configureClock(10, pigpio.CLOCK_PWM)
const Gpio = pigpio.Gpio;
// set gpio pins
const motor1 = new Gpio(20, { mode: Gpio.OUTPUT });
const motor2 = new Gpio(26, { mode: Gpio.OUTPUT });
const motor3 = new Gpio(21, { mode: Gpio.OUTPUT });
const motor4 = new Gpio(16, { mode: Gpio.OUTPUT });
function speeds(m1, m2, m3, m4) {
if (m1 > 1450) {
m1 = 1450;
}
if (m2 > 1450) {
m2 = 1450
}
if (m3 > 1450) {
m3 = 1450
}
if (m4 > 1450) {
m4 = 1450
}
if (m1 < 1185) {
m1 = 1185;
}
if (m2 < 1185) {
m2 = 1185
}
if (m3 < 1185) {
m3 = 1185
}
if (m4 < 1185) {
m4 = 1185
}
motor1.servoWrite(m1)
motor2.servoWrite(m2)
motor3.servoWrite(m3)
motor4.servoWrite(m4)
} |
The code posted above doesn't do very much. It only creates four The readme has an example that shows how to generate a waveform. If your application is running too slowly, then you will need to figure out why it is running too slowly. Switching from using the |
Mmmm this is sooooo weird if weveform same speed of servowrite ....... Can you give your WhatsApp so i can explain to you i and show you whats happing my be here i make its not clear enough |
That's not something I can do. |
hey i am trying to using pigpio with 4 motors using pins 20 21 26 16 the problem is that its not fast enough i need to set up the frequencies and the dutyCycle for thes pins
for those pins pwm set up functions will not work i try it out
and i try this function its give me error hardwarePwmWrite can you give me example with numbers
The text was updated successfully, but these errors were encountered: