Open arpicheck opened 5 years ago
The original Blockly implementation is in Javascript which just uses one general purpose number type so this works fine for JavaScript. The Arduino uses C which has many more numeric types and is much stricter about their usage. Some of the other functions available in the DropDown list such as log
may return a decimal value so by default this block returns a decimal because it would be the most accurate. When the logic_compare
block checks that the condition is valid it considers DECIMAL compared to SCALAR to be invalid and rejects the comparison as shown in the first example.
The second example probably does an internal conversion of 10 to 10.0 and avoids the type check.
A couple of possible fixes (probably more)
You can not formulate the following expression, but there is a workaround: