From 95dbcaffda70862beb45a3c015bd646f38ec5e57 Mon Sep 17 00:00:00 2001 From: Alexander Bobkov Date: Tue, 17 Jun 2025 21:43:05 -0400 Subject: [PATCH] ESP-NOW Transmitter --- ESP32-IDF_ESPNOW-Transmitter/main/joystick.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ESP32-IDF_ESPNOW-Transmitter/main/joystick.c b/ESP32-IDF_ESPNOW-Transmitter/main/joystick.c index e69de29bb..9753b08f1 100644 --- a/ESP32-IDF_ESPNOW-Transmitter/main/joystick.c +++ b/ESP32-IDF_ESPNOW-Transmitter/main/joystick.c @@ -0,0 +1,6 @@ +int convert_axis_to_pwm(int axis_value) { + // Convert the joystick axis value to a PWM value + // Assuming axis_value is in the range of 0-4095 for a 12-bit ADC + // and we want to map it to a PWM range of 0-255 + return (axis_value * 255) / 4095; +} \ No newline at end of file