421 views
in Embedded Wizard Studio by

Hello Paul,

      For your previous explanation I'm afraid you didn't see my problem 

     I don't quite understand your explanation .

Step 1: I set up a Device Interface and set up a method;

Step 2: I directly call this new defined function.

Question:Why is my result not equal to the correct answer ?Did I do something wrong ?

Thanks!

Best regards,

Tonny 

1 Answer

0 votes
by

Hi Tonny,

let me try to help you - even I'm not Paul ;-)

Did you run this example on your target or within the Prototyper? Within the Prototyper the result will be 0.0, because the native code (= the call to log10()) cannot be executed and is excluded by using the $if ... $endif macros.

Best regards,

Manfred.

by

Hello Manfred,

    sorry!   Manfred,

   This example,I'm using this example to try it,

   What to do now ?Is my thinking correct?

Best regards,

Tonny

by

Hi Tonny,

$if !$prototyper
...
$endif

was the correct statement. Writing an empty $if condition will cause the reported error.

Best regards,

Manfred.

by

Hello Manfred,

    But the result still equal 0.0,

    The correct thing is :   Log10(100)  =  2

   Is there any way to solve it ?

Best regards,

Tonny

by
Within the Prototyper, the result is 0.0 because you cannot execute the native code within the Prototyper. Within line 2 you set the result to 0.0. It is not changed, because the native code is not executed.

You can execute the code on your target. What target are you using? Does it work on the target?

Maybe you can explain what kind of GUI / project you are developing - this helps to understand your questions better.

Best regards,

Manfred.
by

Hello Manfred.

    Thank you for your patience

      I need to calculate a set of data   and need to use log_math function to draw a stroked Path line.

      But I don't know how to use this definition.

     In the  Slot method,How do I call it and set it as my target?Can't i call it like a picture?

Best regards

Tonny

    

by

Hello Tonny,

with "target" I mean your hardware. What hardware are you using? Does the native code with the log() call work on the hardware?

Best regards,

Manfred.

Embedded Wizard Website | Privacy Policy | Imprint

...