PWM (Pulse-width modulation) is a technique for controlling power to electrical devices, made practical by modern electronic power switches.
Questions tagged [pwm]
468 questions
0
votes
1 answer
Light Controller in Java
I have IoT project for my thesis, and I am stuck on this kind of problem.
This project is reacting to the incidenting light.
I have getter for light sensor value[getLightValue()]
I have getters and Setters for RGBW color from LED…

Radovan Kočík
- 61
- 1
- 2
- 7
0
votes
1 answer
Simple way to plot PWM over time
I want to plot the PWM emitted by pin 9 and read by pin 0 in a static PWM signal (like an oscilloscope can do). Is there a simple way to do that?
int pwm = 254;
float pulse1;
void setup() {
pinMode(9, OUTPUT);
pinMode(0, INPUT);
…

Artur Müller Romanov
- 4,417
- 10
- 73
- 132
0
votes
2 answers
PWM transistor heating - Rapberry
I have a raspberry and an auxiliary PCB with transistors for driving some LED strips.
The strips datasheets says 12V, 13.3W/m, i'll use 3 strips in parallel, 1.8m each, so 13.3*1.8*3 = 71,82W, with 12 V, almost 6A.
I'm using an 8A transistor,…

Rodrigo Vernini
- 25
- 5
0
votes
2 answers
stm32 generate PWM signal with multiple channels
HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_1);
HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_2);
TIM3->CCR1 =25000;
I'm trying to set 2 pins to the same PWM signal at the same time.
However, it doesn't work. Only 1 pin (channel 1) has PWM output and the 2nd…

Nick Sun
- 11
- 1
- 1
0
votes
1 answer
Raspberry Pi PWM with Ultrasound Transducers
I need to generate a 1Mhz short unipolar pulse every 20 seconds to generate an ultrasonic pulse on my ultrasonic transducers. What do you think is the best way to do this? My plan was to connect the transducers to the PWM pins and use pigpio to…

Bharathi Sara
- 73
- 3
- 13
0
votes
1 answer
Arduino PWM program to generate a frequency in a loop
I am new to Arduino, and right now I am trying to generate a frequency that gradually decreases (without using the tone library) in a program that gradually increases the delay between the switching of the high and low. I have the arduino connected…

L. Z
- 27
- 1
- 1
- 5
0
votes
2 answers
Generating output with 20% duty cycle using only one counter
If i have micro with no PWM module , how to generate output of duty cycle (20%) on pin 1 , and output with duty cycle(80) on pin2
using one counter and interrupt not polling.

W.Wafi
- 11
- 2
0
votes
0 answers
How do you define pitch yaw for quadcopter with Multiwii?
I have a problem defining pitch and yaw for my quadcopter. Every time I set my PWM for my yaw to 1500, it's not affecting my yaw, but instead it's affecting my roll. I did not even do anything to my roll, and the PWM value of my roll is locked to…

Kodean
- 1
- 1
0
votes
0 answers
Running a DC motor in linear sinusoidal motion with arduino, controlling hertz and direction change
After some searching around online I am able to run a 2-wire DC motor in a sinusoidal manner. It is a deconstructed printer carriage driven with an Arduino Uno and L298N motor driver. I'm using a potentiometer to control frequency. The code works…

Tim Truty
- 145
- 1
- 13
0
votes
2 answers
Dim a LED with python without a loop
I want to dim a LED with a Raspberry Pi 3. It works in loop perfect. But how do I dim the LED let's say 50% constantly? Without the script running in a loop. I want to start the python script that dims the LED and then stop it and the LED should…

truemiro
- 103
- 1
- 8
0
votes
0 answers
Stm32 PWM sampling
I have a timer set up in the cube to make a PWM... Just setting ARR and CCR to different values.
I'm using the callback functions for both events that HAL set up for me, I think one is for the CCR compare event and the other is for the ARR compare…

testname123
- 1,061
- 3
- 20
- 43
0
votes
1 answer
How to limit the range of PWM duty-cycle values?
I'm having a hard time finding what I suspect is a pretty silly mistake in my code. I'm using an ATmega328.
What I need is to generate a PWM signal whose duty cycle varies not between 0% and 100%, but between two other values. This is taken into…

Tendero
- 1,136
- 2
- 19
- 34
0
votes
1 answer
Why isn't PWM signal coming out?
I'm doing a project for which I need two measurements from two different ADCs and two different PWM signals related to them. The values measured are stored in the variables freq and duty. As the names state, I want one PWM signal's frequency to vary…

Tendero
- 1,136
- 2
- 19
- 34
0
votes
1 answer
Can i use different timer channels when other channels (of the same timer) have i2c alternate function
My embedded device has i2c on the following pins
GPIO_2 => GPT0_CH2 => configured as i2c SDA
GPIO_3 => GPT0_CH3 => configured as i2c SCL
and i've set up the other channels as
GPIO_0 => GPT0_CH0 => configured as PWM Led
GPIO_1 => GPT0_CH1 =>…

Luigi
- 376
- 3
- 16
0
votes
1 answer
change PWM duty cycle from within ISR
I have little problems implementing a dither function to upgrade the PWM resolution of my ATmega88 and the leds it's controlling.
My thought was, to use a "kind of" floating number, consisting of two uint8_t as "decimal places" so that e.g. "255.31"…

Sim Son
- 310
- 1
- 10