Closed longinos closed 10 years ago
Not sure why exp() is not available. This is the first time that I run into this. As a work-around for now you can replace exp() with expf();
It turns out that exp() is not ANSI C and hence is not implemented in mspgcc. When we move to RedHat GCC these functions will be available. Until thenyou can replace exp() with expf().
while i was cratin a little code for a neural network de IDE show this.
sketch_feb19a.cpp.o: In function
loop': /home/longinos/energia-0101E0011/sketch_feb19a.ino:20: undefined reference to
exp' /home/longinos/energia-0101E0011/sketch_feb19a.ino:27: undefined reference to `exp' collect2: ld returned 1 exit statusin the top of the sketch i have include the math.h library.... i dont know what to do.
here is all my code
include "math.h"
float sensor = P2_0; int ledPin = GREEN_LED;
float entrada = 0; long AUX = 0;
void setup() { Serial.begin(9600); pinMode(ledPin, OUTPUT);
pinMode(entrada, INPUT);
}
void loop() {
entrada = analogRead(sensor); entrada=map(entrada,0,4095,-6,6); AUX=1/(1+exp(-entrada));
Serial.println(AUX);
}