GetCurrentReading() methode, comment ça marche ?
bonjour à tous,
dans sa doc microsoft nous donne cette methode pour 1 lecture du compas, je sais pas comment l'utiliser : quelqu'un peut me dire comment je dois faire pour récupérer l'angle du nord magnétique dans une variable double, est-ce possible ?
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| private void DisplayCurrentReading(object sender, object args)
{
CompassReading reading = _compass.GetCurrentReading();
if (reading != null)
{
textBlock.Text = String.Format("{0,5:0.00}", reading.HeadingMagneticNorth);
if (reading.HeadingTrueNorth != null)
{
textBlock.Text = String.Format("{0,5:0.00}", reading.HeadingTrueNorth);
}
else
{
textBlock.Text = "No data";
}
}
} |
merçi