Go to the documentation of this file.00001
00005
00006
00007 #include "inclinometer.h"
00008
00009
00010
00011 double GetRoll ()
00012 {
00013 #ifdef __DEBUG__INC__
00014 Serial.println("Getting roll...");
00015 #endif
00016
00017 double VoutX = analogRead(A1);
00018 return -asin (( ((VoutX*5.0)/1023.0) -2.5) /2.0);
00019 }
00020
00021
00022
00023 double GetPitch()
00024 {
00025 #ifdef __DEBUG__INC__
00026 Serial.println("Getting pitch...");
00027 #endif
00028
00029 double VoutY = analogRead(A0);
00030 return -asin (( ((VoutY*5.0)/1023.0) -2.5) /2.0);
00031 }
00032
00033
00034