Issues with Arduino Mega to ADXL345 Accelerometer Code

Hello! I do hope I am posting this in the right area. I have an idea and am attempting to run a few tests in order to see if it is doable or not. But I get an error code that I am not entirely sure what it means. Here is the error:

Arduino: 1.6.3 (Windows 8.1), Board: “Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)”

C:\Users\NEVERM~1\AppData\Local\Temp\build4347706786189926824.tmp/core.a(wiring.c.o): In function `delay’:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/wiring.c:113: undefined reference to `yield’

collect2.exe: error: ld returned 1 exit status

Error compiling.

What does that mean?

This is the code that I am running (I borrowed from eeenthusiast.com in order to test this):

#include <Wire.h>

#define accel_module (0x53)
byte values[6] ;
char output[512];

void setup(){
Wire.begin();
Serial.begin(9600);

Wire.beginTransmission(accel_module);
Wire.write(0x2D);
Wire.write(0);
Wire.endTransmission();
Wire.beginTransmission(accel_module);
Wire.write(0x2D);
Wire.write(16);
Wire.endTransmission();
Wire.beginTransmission(accel_module);
Wire.write(0x2D);
Wire.write(8);
Wire.endTransmission();
}

void loop(){
int xyzregister = 0x32;
int x, y, z;

Wire.beginTransmission(accel_module);
Wire.write(xyzregister);
Wire.endTransmission();

Wire.beginTransmission(accel_module);
Wire.requestFrom(accel_module, 6);

int i = 0;
while(Wire.available()){
values[i] = Wire.read();
i++;
}
Wire.endTransmission();

x = (((int)values[1]) << 8) | values[0];
y = (((int)values[3])<< 8) | values[2];
z = (((int)values[5]) << 8) | values[4];

sprintf(output, "%d %d %d", x, y, z);
Serial.print(output);
Serial.write(10);

delay(2000);
}

When I compile your code for the Mega, using 1.0.5, I get just one "error" message:

Binary sketch size: 7,596 bytes (of a 258,048 byte maximum)

In 1.6.5 r2 for Windows, all I get is

Sketch uses 5,956 bytes (2%) of program storage space. Maximum is 253,952 bytes.

Global variables use 918 bytes (11%) of dynamic memory, leaving 7,274 bytes for local variables. Maximum is 8,192 bytes.

So does that mean i have it set up wrong?

So does that mean i have it set up wrong?

Yes. You should (apparently) only use versions of the IDE ending in 5.

Well, try switching to 1.6.5. Just download the zip, extract it, and open arduino.exe.