// ...some very simple DShot example generating a DShot300 signal. #include #include // ...clearly name usb port #ifdef SERIAL #define USB_Serial Serial constexpr auto USB_SERIAL_BAUD = 115200; #endif // SERIAL DShotRMT motor01(GPIO_NUM_4, RMT_CHANNEL_0, DSHOT300, false); volatile uint16_t throttle_value = 0x30; // ...sending "48", the first throttle value constexpr auto FAILSAVE_THROTTLE = 0x3E7; void setup() { // ...always start the onboard usb support USB_Serial.begin(USB_SERIAL_BAUD); } void loop() { read_SerialThrottle(); motor01.send_dshot_value(throttle_value); // ...print to console USB_Serial.println(throttle_value); } // // uint16_t read_SerialThrottle() { if (USB_Serial.available() > 0) { auto throttle_input = (USB_Serial.readStringUntil('\n')).toInt(); return throttle_input; } else { return FAILSAVE_THROTTLE; } }