/*Interfacing ADXL335 with Mediatek LinkIt One*/ int groundpin; int powerpin; const int xpin = A0; // x-axis of the accelerometer const int ypin = A1; // y-axis const int zpin = A2; // z-axis const String XHEADER = "X: "; const String YHEADER = "Y: "; const String ZHEADER = "Z: "; const String TAB = "\t"; void setup() { // initialize the serial communications: Serial.begin(9600); // Power and ground the necessary pins. Providing power to both // the analog and digital pins allow me to just use the breakout // board and not have to use the normal 5V and GND pins pinMode(groundpin, OUTPUT); pinMode(powerpin, OUTPUT); digitalWrite(groundpin, LOW); digitalWrite(powerpin, HIGH); } void loop() { // print values that are recieved from the sensors and put a tab between // the values Serial.print(XHEADER + analogRead(xpin) + TAB); Serial.print(YHEADER + analogRead(ypin) + TAB); Serial.print(ZHEADER + analogRead(zpin)); Serial.println(); delay(200); }