Permalink
Browse files

New C# example: SensorReading

  • Loading branch information...
thp committed Jan 9, 2013
1 parent db46bbc commit b983f37b976b37731b473095a03bc89ab053d5df
Showing with 26 additions and 0 deletions.
  1. +26 −0 examples/csharp/SensorReading.cs
@@ -0,0 +1,26 @@
+
+using System;
+using io.thp.psmove;
+
+public class SensorReading {
+ public static int Main(string [] args) {
+ PSMove move = new PSMove();
+
+ while (true) {
+ if (move.poll() != 0) {
+ int trigger = move.get_trigger();
+
+ float ax, ay, az;
+ move.get_accelerometer_frame(Frame.Frame_SecondHalf,
+ out ax, out ay, out az);
+
+ Console.WriteLine(string.Format("Trigger: {0:0}, " +
+ "Accelerometer: {1:0.00} {2:0.00} {3:0.00}",
+ trigger, ax, ay, az));
+ }
+ }
+
+ return 0;
+ }
+};
+

0 comments on commit b983f37

Please sign in to comment.