---
title: "Comment by Ahmed on \"Generating PWM pulses on the STM32F407 for Servo Motor Control using Bare-Metal Programming\" | Hashnode"
description: "Hi Sir! Can you help how to modify this code if I need to change intensity of motor inversely propotional to distance from some obstacle (detected by ultrasonic"
url: "https://hashnode.com/posts/generating-pwm-pulses-on-the-stm32f407-for-servo-motor-control-using-bare-metal-programming/6149657b699fe76cd34857fb/comment/6633ebbe7f1ae6616ce91fef"
---

[Discussion](https://hashnode.com/posts/generating-pwm-pulses-on-the-stm32f407-for-servo-motor-control-using-bare-metal-programming/6149657b699fe76cd34857fb)

Comment [Generating PWM pulses on the STM32F407 for Servo Motor Control using Bare-Metal Programming](https://hashnode.com/posts/generating-pwm-pulses-on-the-stm32f407-for-servo-motor-control-using-bare-metal-programming/6149657b699fe76cd34857fb)

[Ahmed](https://hashnode.com/@Ahmed1234)

[May 2, 2024](https://hashnode.com/posts/generating-pwm-pulses-on-the-stm32f407-for-servo-motor-control-using-bare-metal-programming/6149657b699fe76cd34857fb/comment/6633ebbe7f1ae6616ce91fef)

Hi Sir! Can you help how to modify this code if I need to change intensity of motor inversely propotional to distance from some obstacle (detected by ultrasonic sensors) Thanks Sir
