//Magnetic Field Vector Pointer Sensor // defining values float xaxis = A0; float yaxis = A1; float zaxis = A2; float outx = 0; float outy = 0; float outz = 0; void setup() { //API setup pinMode(xaxis,INPUT); pinMode(yaxis,INPUT); pinMode(zaxis,INPUT); Serial.begin(9600); delay(100); } void loop() { //what circuit does outx = analogRead(xaxis); outy = analogRead(yaxis); outz = analogRead(zaxis); outx = (outx-189); outx = outx*0.887; outy = (outy-189); outy = outy*0.887; outz = (outz-189); outz = outz*0.887; int res = sqrt(sq(outx)+sq(outy)+sq(outz)); Serial.print("X-axis:"); Serial.print(outx); Serial.print("uT"); Serial.print(" Y-axis:"); Serial.print(outy); Serial.print("uT"); Serial.print(" Z-axis:"); Serial.print(outz); Serial.println("uT"); Serial.print("Resultant Vector(in uT):"); Serial.println(res); delay(500); }