How to convert const real_T value to double ?
이전 댓글 표시
Hi, I have a problem with a piece of my code:
static void mdlOutputs(SimStruct *S, int_T tid)
{
#ifndef MATLAB_MEX_FILE
InputRealPtrsType uPtrs = ssGetInputPortRealSignalPtrs(S,0);
ds1104_slave_dsp_pwm_duty_write_register(task_id, &ch1_index, 1);
if (*uPtrs < 1.0)
ds1104_slave_dsp_pwm_duty_write(task_id, ch1_index, 0.0);
else
ds1104_slave_dsp_pwm_duty_write(task_id, ch1_index, 1.0);
#endif
}
It doesn't work because of incompatible operand types ("const real_T *" and "double") here : " *uPtrs < 1.0 "
I don't know how to correct it, your help will be welcome.
Thanks
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Functions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!