I am currently using Arduino Uno ATMega328 and am looking to use the Natural Log function.
Online I read I need to use Arduino ATMega168, though that seems likea downgrade. How can I start using the Natural Log function on my Aruino, such as in this equation
y = -0.317ln(x) + 1.3286
Does the Arduino Micro ATmega32u4 allow me to use Natural Log?
I think, you misunderstood function usage - C basics: double log(double x)
means that the function requires parameter type double and returns value type double.
I should be just:
y = log(2);
but y should be defined as double and also consider that you are using constant as parameter in loop function and the result will be always the same.
// 'log' is defined as returning a double precision floating point value as in ...
// double log(double x);
// ... on most Arduinos 'double' is in fact a 'float'
double y = log(2);
Serial.print(y);