Skip to content

Scales duty cycle from one range (e.g., 1000 us to 2000 us) and writes to another range (e.g., 500 us to 2500 us)

Notifications You must be signed in to change notification settings

kristanhilby/PWM-arduino-rescaling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This Arduino script offers a convenient solution for reading PWM signals from RC receivers, such as the FrSky X8R, and remapping their range. By default, most RC receivers output signals in the standard range of 1000 - 2000 microseconds (us). However, certain applications, especially those involving servos, may require a different signal range, typically around 500 - 2500 us. This library simplifies the process of adapting the incoming RC signal to match this common servo range in a non-blocking manner.

Other Required Libraries To activate the interrupt pins, the RP2040_ISR_Servo Library was also used. Note that the standard Raspberry Pi Pico board should be chosen, rather than RP2040 specifically see this Github issue).

Key Features:

  • Reads PWM signals from an RC receiver.
  • Remaps the signal range from 1000 - 2000 us to 500 - 2500 us.
  • Suitable for use with microcontroller boards like the Seeed XIAO RP2040.
  • Detailed instructions for interfacing with the Seeed XIAO RP2040 board via Arduino are provided, making it easy to get started.

Usage:

  1. Connect your RC receiver to the designated input pins on your microcontroller board (e.g., Seeed XIAO RP2040).
  2. Include the library in your Arduino sketch.
  3. Initialize the library and specify the input pin for the RC receiver.
  4. Use the library's functions to read and remap the PWM signal as needed for your project.

This library streamlines the process of adapting RC receiver signals for applications that require a different input range, ensuring compatibility and ease of use. Whether you're working with servos or other components, this library simplifies the interfacing process, helping you achieve precise control in your projects.

Seeed Xiao RP2040 PinOut Notes: The pinouts for programming with this board can be seen in the following graphic. In the code provided, pins 26, 27, 28, and 29 are used, which correspond to pins 0, 1, 2, and 3 on the board. https://files.seeedstudio.com/wiki/XIAO-RP2040/img/xinpin.jpg

About

Scales duty cycle from one range (e.g., 1000 us to 2000 us) and writes to another range (e.g., 500 us to 2500 us)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages