Difference between revisions of "Component: Temperature (DS1822) (Environmental)"
Line 78: | Line 78: | ||
{{fcfile|Example_DS1822.fcfx|Example DS1822}} | {{fcfile|Example_DS1822.fcfx|Example DS1822}} | ||
+ | |||
+ | |||
Line 83: | Line 85: | ||
==Macro reference== | ==Macro reference== | ||
+ | ===SampleAllDevices=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 101: | Line 104: | ||
+ | ===AddressSpecificDevice=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 119: | Line 123: | ||
+ | ===GetSerialString=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 132: | Line 137: | ||
+ | ===AddressNextDevice=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 145: | Line 151: | ||
+ | ===GetTemperature=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 158: | Line 165: | ||
+ | ===SampleAddressedDevice=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 176: | Line 184: | ||
+ | ===Initialise=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- |
Revision as of 11:52, 3 February 2023
Author | MatrixTSL |
Version | 1.0 |
Category | Environmental |
Contents
Temperature (DS1822) component
A rugged temperature sensor allowing one or more sensors to be addressed and read. Capable of reading temperatures from -55 to +125 degrees C. Requires a One Wire component to perform the bus operations.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_Temperature_DS1822.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_Temperature_DS1822.fcfx
Detailed description
No detailed description exists yet for this component
Examples
This example shows how to connect the DS1822 component to the OneWire component and either select a specific device on the bus or scan through the devices on the bus collecting the temperature readings.
The temperature and serial number is output using a UART connection as is onboard a Arduino or ESP32 device.
Macro reference
SampleAllDevices
AddressSpecificDevice
GetSerialString
![]() |
GetSerialString |
Gets the Serial String for the current addressed device. | |
![]() |
Return |
AddressNextDevice
![]() |
AddressNextDevice |
Scans for the next connected device with a matching family code. Goes through the device list generated by the ScanBus macro. | |
![]() |
Return |
GetTemperature
![]() |
GetTemperature |
Reads the temperature from the last sample on the selected device. The selected device is set using the AddressNext or AddressSpecific macros. | |
![]() |
Return |
SampleAddressedDevice
Initialise
![]() |
Initialise |
Configures each matching sensor on the bus with the specified conversion bits. | |
![]() |
Return |