Share via


Magnetometer.ReadingChanged Event

Definition

Occurs each time the compass reports a new sensor reading.

// Register
event_token ReadingChanged(TypedEventHandler<Magnetometer, MagnetometerReadingChangedEventArgs const&> const& handler) const;

// Revoke with event_token
void ReadingChanged(event_token const* cookie) const;

// Revoke with event_revoker
Magnetometer::ReadingChanged_revoker ReadingChanged(auto_revoke_t, TypedEventHandler<Magnetometer, MagnetometerReadingChangedEventArgs const&> const& handler) const;
public event TypedEventHandler<Magnetometer,MagnetometerReadingChangedEventArgs> ReadingChanged;
function onReadingChanged(eventArgs) { /* Your code */ }
magnetometer.addEventListener("readingchanged", onReadingChanged);
magnetometer.removeEventListener("readingchanged", onReadingChanged);
- or -
magnetometer.onreadingchanged = onReadingChanged;
Public Custom Event ReadingChanged As TypedEventHandler(Of Magnetometer, MagnetometerReadingChangedEventArgs) 

Event Type

Remarks

An application may register this event handler to obtain sensor readings. The application must establish a desired ReportInterval. This informs the sensor driver that resources should be allocated to satisfy the requirements of the application.

Applications can set the frequency of this event by setting the ReportInterval property.

Applies to