![]() |
Erriez Oregon THN128 433MHz temperature sensor library for Arduino
1.1.0
This is an Oregon THN128 433MHz temperature sensor transmit/receive library for Arduino.
|
Oregon THN128 433MHz temperature receive library for Arduino. More...
#include <stdint.h>
#include "ErriezOregonTHN128.h"
Go to the source code of this file.
Functions | |
void | OregonTHN128_RxBegin (uint8_t extIntPin) |
Initialize receiver pin. More... | |
void | OregonTHN128_RxEnable () |
Receive enable. | |
void | OregonTHN128_RxDisable () |
Receive disable. | |
bool | OregonTHN128_Available (void) |
Check if data received. More... | |
bool | OregonTHN128_Read (OregonTHN128Data_t *data) |
Read data. More... | |
Oregon THN128 433MHz temperature receive library for Arduino.
Source: https://github.com/Erriez/ErriezOregonTHN128 Documentation: https://erriez.github.io/ErriezOregonTHN128
Protocol:
Transmit temperature twice every 30 seconds:
Bit: 0 7 0 7 0 7 0 7 +-—+-—+---—+---—+---—+---—+ +-—+-—+---—+– |PREA|SYNC|Byte 0|Byte 1|Byte 2|Byte 3| |PREA|SYNC|Byte 0| ... +-—+-—+---—+---—+---—+---—+-—/\/-—+-—+-—+---—+– |<------------— 144ms ----------—>|<- 100ms ->| 30 sec
Logic '0': Logic '1': +-—+ +-—+ | | +-—+ +-—+ 1400 1500 1500 1400 (us)
PREA: Preamble 12x logic '1', 3000us low
SYNC: +-----—+ | |
Byte 0:
Byte 1:
Byte 2:
Byte 3:
Example: Rolling address = 5, channel = 1, temperature = 27.8 `C, low battery = false TH1 = 2, TH2 = 7, TH3 = 8: Byte 0: 0x05 Byte 1: 0x78 Byte 2: 0x02 Byte 3: 0x7f
Bits in time: PRE=1 S B0=0x05 B1=0x78 B2=0x02 B3=0x7f 111111111111 S 10100000 00011110 01000000 11111110
Definition in file ErriezOregonTHN128Receive.h.
bool OregonTHN128_Available | ( | void | ) |
Check if data received.
true | Data received |
false | No data available |
Definition at line 358 of file ErriezOregonTHN128Receive.c.
bool OregonTHN128_Read | ( | OregonTHN128Data_t * | data | ) |
Read data.
data | Structure OregonTHN128Data_t output |
true | Data received |
false | No data available |
Definition at line 373 of file ErriezOregonTHN128Receive.c.
void OregonTHN128_RxBegin | ( | uint8_t | extIntPin | ) |
Initialize receiver pin.
Connect RX pin to an external interrupt pin such as INT0 (D2) or INT1 (D3)
extIntPin |
Definition at line 324 of file ErriezOregonTHN128Receive.c.