Go Down

Topic: adding two absolute values arduino (Read 65 times) previous topic - next topic

tom321


Hi
I am trying to add two abs but I have an error, what is the solution ?

Code: [Select]
x = abs(fvin - fVo) + abs(Irms / 1000  - Vo, 3);


 error: macro "abs" passed 2 arguments, but takes just 1
 x = abs(fvin - fVo) + abs(Irms / 1000  - Vo, 3);

groundFungus

#1
Sep 17, 2020, 02:15 am Last Edit: Sep 17, 2020, 02:26 am by groundFungus
What is the 3 for?  (not decimal places,  check the reference)

The comma is a delimiter between arguments, that is why the compiler thinks there are 2 arguments to a 1 argument function.
You will save everyone's time if you read and follow the forum guidelines.  :)           
https://forum.arduino.cc/index.php/topic,148850.0.html

tom321


Go Up