# ESP32 not receiving Serial Input after I give the target velocity

**URL:** https://community.simplefoc.com/t/esp32-not-receiving-serial-input-after-i-give-the-target-velocity/3396
**Category:** hardware support
**Created:** [May 25, 2023, 6:04am UTC](https://community.simplefoc.com/t/esp32-not-receiving-serial-input-after-i-give-the-target-velocity/3396 "2023-05-25T06:04:31Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![harishs8](https://community.simplefoc.com/user_avatar/community.simplefoc.com/harishs8/32/4955_2.png) [@harishs8](https://community.simplefoc.com/u/harishs8)
#### Post date: [May 25, 2023, 6:04am UTC](https://community.simplefoc.com/t/esp32-not-receiving-serial-input-after-i-give-the-target-velocity/3396/1 "2023-05-25T06:04:32Z")

</div>

Hi, I am trying to use ESP32 Wroom 32 with TMC6300, with 6PWM driver.

```auto
> // Open loop motor control example
> #include <SimpleFOC.h>
> 
> 
> // BLDC motor & driver instance
> // BLDCMotor motor = BLDCMotor(pole pair number);
> BLDCMotor motor = BLDCMotor(11);
> // BLDCDriver3PWM driver = BLDCDriver3PWM(pwmA, pwmB, pwmC, Enable(optional));
> BLDCDriver6PWM driver = BLDCDriver6PWM(26,25,27,32,12,33);
> 
> // Stepper motor & driver instance
> //StepperMotor motor = StepperMotor(50);
> //StepperDriver4PWM driver = StepperDriver4PWM(9, 5, 10, 6, 8);
> 
> 
> //target variable
> float target_velocity = 5;
> 
> // instantiate the commander
> Commander command = Commander(Serial);
> void doTarget(char* cmd) { command.scalar(&target_velocity, cmd); }
> void doLimit(char* cmd) { command.scalar(&motor.voltage_limit, cmd); }
> 
> void setup() {
> 
> // driver config
> // power supply voltage [V]
> driver.voltage_power_supply = 5;
> // limit the maximal dc voltage the driver can set
> // as a protection measure for the low-resistance motors
> // this value is fixed on startup
> driver.voltage_limit = 3;
> driver.init();
> // link the motor and the driver
> motor.linkDriver(&driver);
> 
> // limiting motor movements
> // limit the voltage to be set to the motor
> // start very low for high resistance motors
> // current = voltage / resistance, so try to be well under 1Amp
> motor.voltage_limit = 3; // [V]
>  
> // open loop control config
> motor.controller = MotionControlType::velocity_openloop;
> 
> // init motor hardware
> motor.init();
> 
> // add target command T
> command.add('T', doTarget, "target velocity");
> command.add('L', doLimit, "voltage limit");
> 
> Serial.begin(115200);
> Serial.println("Motor ready!");
> Serial.println("Set target velocity [rad/s]");
> _delay(1000);
> }
> 
> void loop() {
> 
> // open loop velocity movement
> // using motor.voltage_limit and motor.velocity_limit
> motor.move(target_velocity);
> 
> // user communication
> command.run();
> }

```

> Blockquote

I am trying to send 5rad/s but it is not taking the data to ESP.

 ![image](https://community.simplefoc.com/uploads/default/original/2X/a/accfbda3c62d8f4d18d1d70f4d0e1c85d6da9e04.png)

---

<div class="post-metadata">

### Author: ![Antun\_Skuric](https://community.simplefoc.com/user_avatar/community.simplefoc.com/antun_skuric/32/21_2.png) [@Antun\_Skuric](https://community.simplefoc.com/u/Antun_Skuric)
#### Post date: [May 25, 2023, 7:53am UTC](https://community.simplefoc.com/t/esp32-not-receiving-serial-input-after-i-give-the-target-velocity/3396/2 "2023-05-25T07:53:06Z")

</div>

Did you use the keyword `T`?

In your commander you added the target callback with the command character `T`. So to change the target send `T5.66` for 5.66 rad/s or `T-10`for -10 rad/s

---

<div class="post-metadata">

### Author: ![harishs8](https://community.simplefoc.com/user_avatar/community.simplefoc.com/harishs8/32/4955_2.png) [@harishs8](https://community.simplefoc.com/u/harishs8)
#### Post date: [May 25, 2023, 3:18pm UTC](https://community.simplefoc.com/t/esp32-not-receiving-serial-input-after-i-give-the-target-velocity/3396/3 "2023-05-25T15:18:23Z")

</div>

Hi Antun,

 ![image](https://community.simplefoc.com/uploads/default/original/2X/a/ad51fb38f412d06272ab24ce2e016751891677bb.png)

I have added the callback with the command character, but I feel there are no outputs coming out of the Control Pins. I have connected LED to the PWM pins of ESP32 - there is no output. I tried connecting to the motor driver end, still no output.

Model : ESP32 Wroom32 Devkit 4.0
