-
Notifications
You must be signed in to change notification settings - Fork 2
Magnet
Kravitz Lab edited this page Jan 26, 2026
·
1 revision
The FED4 has an MLX90393 magnetometer on the secondary I2C bus (address 0x0C). It is currently not used by any built-in FED4 programs; the API is available for custom sketches.
API
-
initializeMagnet()— init sensor (called frombegin()). UsesconfigureMagnet()with default gain (5×). -
readMagnetData(x, y, z)— read magnetic field (µT) intofloatrefs. Returnstrueon success. -
getMagnetEvent(&event)— raw data viasensors_event_t. -
setMagnetGain(...)/getMagnetGain()— configure or read gain (e.g.MLX90393_GAIN_5X). -
configureMagnet(gain)— set gain, resolution, oversampling, and filter (default 5× gain).
See FED4_Magnet.cpp. Hardware: Adafruit MLX90393, Adafruit library.