I'm quite a newbie to this and I've been struggling for sometime now with my school project, trying to find a way to send accelerometer data from my MMA7361 in data packets, I understand that I have to send the data in packets, but I'm having problems going about it. One of the requirements of the project is that I have to send the data in array-packets of all the individual axes (e.g. a buffer array to hold the x-axis value, another for the y-axis value and also for the z-axis value). I have read quite a lot of documentation on the internet about this but putting it together is a challenge. Below is the infamous MMA7361 code sketch, do please help out if you can thankyou.
#include <AcceleroMMA7361.h>
AcceleroMMA7361 accelero;
int x;
int y;
int z;
void setup(){
Serial.begin(9600);
accelero.begin(13, 12, 11, 10, A0, A1, A2);
accelero.setARefVoltage(3.3); //sets the AREF voltage to 3.3V
accelero.setSensitivity(LOW); //sets the sensitivity to +/-6G
accelero.calibrate();
}
void loop(){
x = accelero.getXRaw();
y = accelero.getYRaw();
z = accelero.getZRaw();
Serial.print("\nx: ");
Serial.print(x);
Serial.print("\ty: ");
Serial.print(y);
Serial.print("\tz: ");
Serial.print(z);
delay(500); //(make it readable)
}