New answers tagged

0

Ok, I was able to use this library to generate waveforms: const pigpio = require('pigpio'); const Gpio = pigpio.Gpio; const outPin = 21; const output = new Gpio(outPin, {mode: Gpio.OUTPUT}); output.digitalWrite(0); while (true){ pigpio.waveClear(); let waveform = []; for (let x = 0; x < 200; x++) { if (x % 2 === 1) { waveform.push({ ...


0

You can use pigpio waves to generate PWM at 38 kHz on multiple GPIO simultaneously. You can do this using the pigpio Python module and there are wrappers for node.js. There are several relevant examples, e.g. https://abyz.me.uk/rpi/pigpio/examples.html#Python_wavePWM_py


0

PWM is a digital signal. You could (at least in principle) monitor to detect the proportion of time it is HIGH. If I wanted to do this I would write code to detect rising and falling edges and times. I am unaware of any existing code although Joan's DHT temperature humidity code would provide an excellent starting point.


0

There are multiple issues associated with RPi.GPIO PWM. E.g. #132 PWM becomes inaccurate after stop() and start(). I suggest you try the workaround of using ChangeDutyCycle instead of start/stop.


1

Look in /boot/overlays/README For PWM the GPIO must be in the correct mode. That varies according to the GPIO. Set the func according to the following table. Name: pwm Info: Configures a single PWM channel Legal pin,function combinations for each channel: PWM0: 12,4(Alt0) 18,2(Alt5) 40,4(Alt0) 52,5(Alt1) PWM1: 13,...


1

You need to look at the .c source code. The .h file is included into the .c source code to make the program. Using the Pico PIO is an advanced topic. If you are intending to learn how to program I suggest you start by using the Pico GPIO block to generate your waveform. If you are not intending to learn how to program you need to hire a programmer ...


Top 50 recent answers are included