peony3000

Gadgeteer Compass

Apr 10th, 2012
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.95 KB | None | 0 0
  1. using System;
  2. using Microsoft.SPOT;
  3. using Microsoft.SPOT.Presentation;
  4. using Microsoft.SPOT.Presentation.Controls;
  5. using Microsoft.SPOT.Presentation.Media;
  6.  
  7. using GT = Gadgeteer;
  8. using GTM = Gadgeteer.Modules;
  9. using Gadgeteer.Modules.Seeed;
  10. using Gadgeteer.Modules.GHIElectronics;
  11.  
  12. namespace Gadgeteer_Compass_01
  13. {
  14.     public partial class Program
  15.     {
  16.        
  17.         void ProgramStarted()
  18.         {
  19.             // setup a compass reading robot event watcher
  20.             compass.MeasurementComplete += new GTM.Seeed.Compass.MeasurementCompleteEventHandler(compass_MeasurementComplete);
  21.             compass.StartContinuousMeasurements();
  22.          
  23.  
  24.             // tell everyone that we have started
  25.             Debug.Print("Program Started");
  26.         }
  27.  
  28.         void compass_MeasurementComplete(GTM.Seeed.Compass sender, GTM.Seeed.Compass.SensorData sensorData)
  29.         {
  30.             Debug.Print(sensorData.ToString());
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment