You are here

Dutycycle set using uart problem

1 post / 0 new
Raja Sharma
Offline
Last seen: 4 years 5 months ago
Joined: 2020-06-01 20:54
Posts: 4
Dutycycle set using uart problem

Hello

i am facing one problem in UART communication mode. When I set dutycycle using 

void VescUart::setDuty(float duty) {
    int32_t index = 0;
    uint8_t payload[5];

    payload[index++] = COMM_SET_DUTY;
    buffer_append_int32(payload, (int32_t)(duty * 100000), &index);

    packSendPayload(payload, 5);
}

function. except zero when I set any value from 1 to 100. the bldc motor runs it's setted max dutycyle. Can any please tell me what am I doing wrong.