Component: Magnetometer (SM324) (Movement Orientation): Difference between revisions
Appearance
m Text replacement - "width="10%" align="center" style="background-color:#D8C9D8;" align="center"" to "width="10%" align="center" class="mtx-class-macrohead"" |
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder"" |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 91: | Line 91: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Initialise''' | ||
|- | |- | ||
| colspan="2" | Sets up the I2C bus ready to communicate with the sensor IC. Sets the address variable back to the Address property value. | | colspan="2" | Sets up the I2C bus ready to communicate with the sensor IC. Sets the address variable back to the Address property value. | ||
| Line 105: | Line 105: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadMagneticFieldRaw''' | ||
|- | |- | ||
| colspan="2" | Reads the magnetic field from the last succesful data read. | | colspan="2" | Reads the magnetic field from the last succesful data read. | ||
| Line 119: | Line 119: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadMagneticFieldReal''' | ||
|- | |- | ||
| colspan="2" | Reads the magnetic field from the last succesful data read as a float in Oersted Oe. | | colspan="2" | Reads the magnetic field from the last succesful data read as a float in Oersted Oe. | ||
| Line 133: | Line 133: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadStatus''' | ||
|- | |- | ||
| colspan="2" | Reads the status byte from the sensor IC. Bit 6 = Voltage OK Bit 5 = Busy Bit 2 = Memory Error Bit 0 = Saturation | | colspan="2" | Reads the status byte from the sensor IC. Bit 6 = Voltage OK Bit 5 = Busy Bit 2 = Memory Error Bit 0 = Saturation | ||
| Line 147: | Line 147: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadTemperatureRaw''' | ||
|- | |- | ||
| colspan="2" | Reads the temperature from the last succesful data read. | | colspan="2" | Reads the temperature from the last succesful data read. | ||
| Line 161: | Line 161: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadTemperatureReal''' | ||
|- | |- | ||
| colspan="2" | Reads the temperature from the last succesful data read as an float in degrees C. | | colspan="2" | Reads the temperature from the last succesful data read as an float in degrees C. | ||
| Line 175: | Line 175: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''RequestData''' | ||
|- | |- | ||
| colspan="2" | Requests temperature and magnetic data from the device, returns status. Bit 6 = Voltage OK Bit 5 = Busy Bit 2 = Memory Error Bit 0 = Saturation | | colspan="2" | Requests temperature and magnetic data from the device, returns status. Bit 6 = Voltage OK Bit 5 = Busy Bit 2 = Memory Error Bit 0 = Saturation | ||
| Line 189: | Line 189: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SetAddress''' | ||
|- | |- | ||
| colspan="2" | Configures the device address used to communicate with sensor IC. Optionally writes the new address to the sensor IC NVM. | | colspan="2" | Configures the device address used to communicate with sensor IC. Optionally writes the new address to the sensor IC NVM. | ||
| Line 213: | Line 213: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''WriteCommand''' | ||
|- | |- | ||
| colspan="2" | Sends a command to the sensor IC. | | colspan="2" | Sends a command to the sensor IC. | ||
| Line 232: | Line 232: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''WriteMemory''' | ||
|- | |- | ||
| colspan="2" | Writes a 16-bit value to the specified memory location | | colspan="2" | Writes a 16-bit value to the specified memory location | ||
| Line 256: | Line 256: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Properties''' | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Sensor Properties | ||
|- | |- | ||
|- | |- | ||
| Line 269: | Line 269: | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | I2C Properties | ||
|- | |- | ||
|- | |- | ||
| Line 318: | Line 318: | ||
| colspan="2" | Baud rate to be used | | colspan="2" | Baud rate to be used | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Threshold Output | ||
|- | |- | ||
|- | |- | ||
| Line 342: | Line 342: | ||
| colspan="2" | Threshold 2 value. If Thresh1 > Thresh2 1: Measurement > Thresh1 OR Measurement < Thresh2 0: Thresh1 > Measurement > Thresh2 If Thresh2 > Thresh1 1: Thresh1 > Measurement > Thresh2 0: Measurement > Thresh2 OR Measurement < Thresh1 | | colspan="2" | Threshold 2 value. If Thresh1 > Thresh2 1: Measurement > Thresh1 OR Measurement < Thresh2 0: Thresh1 > Measurement > Thresh2 If Thresh2 > Thresh1 1: Thresh1 > Measurement > Thresh2 0: Measurement > Thresh2 OR Measurement < Thresh1 | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Simulation | ||
|- | |- | ||
|- | |- | ||
Latest revision as of 14:37, 13 July 2026
| Author | Matrix TSL |
| Version | 1.0 |
| Category | Movement Orientation |
Magnetometer (SM324) component
SM324 ultraprecise 24-bit smart magnetometer capable of distance measurement using a magnet. Controlled via I2C bus communications.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_Magnetometer_SM324.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_Magnetometer_SM324.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
Initialise
| Initialise | |
| Sets up the I2C bus ready to communicate with the sensor IC. Sets the address variable back to the Address property value. | |
| Return | |
ReadMagneticFieldRaw
| ReadMagneticFieldRaw | |
| Reads the magnetic field from the last succesful data read. | |
| Return | |
ReadMagneticFieldReal
| ReadMagneticFieldReal | |
| Reads the magnetic field from the last succesful data read as a float in Oersted Oe. | |
| Return | |
ReadStatus
| ReadStatus | |
| Reads the status byte from the sensor IC. Bit 6 = Voltage OK Bit 5 = Busy Bit 2 = Memory Error Bit 0 = Saturation | |
| Return | |
ReadTemperatureRaw
| ReadTemperatureRaw | |
| Reads the temperature from the last succesful data read. | |
| Return | |
ReadTemperatureReal
| ReadTemperatureReal | |
| Reads the temperature from the last succesful data read as an float in degrees C. | |
| Return | |
RequestData
| RequestData | |
| Requests temperature and magnetic data from the device, returns status. Bit 6 = Voltage OK Bit 5 = Busy Bit 2 = Memory Error Bit 0 = Saturation | |
| Return | |
SetAddress
WriteCommand
| WriteCommand | |
| Sends a command to the sensor IC. | |
| Command | |
| Return | |
WriteMemory
| WriteMemory | |
| Writes a 16-bit value to the specified memory location | |
| Address | |
| Internal memory address | |
| Value | |
| Return | |