Skip to content
This repository
Browse code

New C# example: SensorReading

  • Loading branch information...
commit b983f37b976b37731b473095a03bc89ab053d5df 1 parent db46bbc
Thomas Perl authored January 09, 2013

Showing 1 changed file with 26 additions and 0 deletions. Show diff stats Hide diff stats

  1. 26  examples/csharp/SensorReading.cs
26  examples/csharp/SensorReading.cs
... ...
@@ -0,0 +1,26 @@
  1
+
  2
+using System;
  3
+using io.thp.psmove;
  4
+
  5
+public class SensorReading {
  6
+    public static int Main(string [] args) {
  7
+        PSMove move = new PSMove();
  8
+
  9
+        while (true) {
  10
+            if (move.poll() != 0) {
  11
+                int trigger = move.get_trigger();
  12
+
  13
+                float ax, ay, az;
  14
+                move.get_accelerometer_frame(Frame.Frame_SecondHalf,
  15
+                        out ax, out ay, out az);
  16
+
  17
+                Console.WriteLine(string.Format("Trigger: {0:0}, " +
  18
+                            "Accelerometer: {1:0.00} {2:0.00} {3:0.00}",
  19
+                            trigger, ax, ay, az));
  20
+            }
  21
+        }
  22
+
  23
+        return 0;
  24
+    }
  25
+};
  26
+

0 notes on commit b983f37

Please sign in to comment.
Something went wrong with that request. Please try again.