Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1993 | - | 1 | #include <Wire.h> |
2 | #include <HMC.h> |
||
3 | int a; |
||
4 | |||
5 | void setup() |
||
6 | { |
||
7 | Serial.begin(9600); |
||
8 | } |
||
9 | |||
10 | void loop() |
||
11 | { |
||
12 | int x,y,z; |
||
13 | delay(100); // There will be new values every 100ms |
||
14 | HMC.getValues(&x,&y,&z); |
||
15 | Serial.print("x:"); |
||
16 | Serial.print(x); |
||
17 | Serial.print(" y:"); |
||
18 | Serial.print(y); |
||
19 | Serial.print(" z:"); |
||
20 | Serial.println(z); |
||
21 | |||
22 | HMC.getAngle(&a); |
||
23 | Serial.println(a); |
||
24 | } |