MySensors Library & Examples
2.3.2-62-ge298769
examples
GatewaySerialRS485
GatewaySerialRS485.ino
1
53
// Enable debug prints to serial monitor
54
#define MY_DEBUG
55
56
// Enable RS485 transport layer
57
#define MY_RS485
58
59
// Define this to enables DE-pin management on defined pin
60
#define MY_RS485_DE_PIN 2
61
62
// Set RS485 baud rate to use
63
#define MY_RS485_BAUD_RATE 9600
64
65
// Enable this if RS485 is connected to a hardware serial port
66
//#define MY_RS485_HWSERIAL Serial1
67
68
// Enable serial gateway
69
#define MY_GATEWAY_SERIAL
70
71
72
// Enable inclusion mode
73
#define MY_INCLUSION_MODE_FEATURE
74
// Enable Inclusion mode button on gateway
75
#define MY_INCLUSION_BUTTON_FEATURE
76
// Set inclusion mode duration (in seconds)
77
#define MY_INCLUSION_MODE_DURATION 60
78
// Digital pin used for inclusion mode button
79
#define MY_INCLUSION_MODE_BUTTON_PIN 3
80
81
// Set blinking period
82
#define MY_DEFAULT_LED_BLINK_PERIOD 300
83
84
// Flash leds on rx/tx/err
85
#define MY_DEFAULT_ERR_LED_PIN 4 // Error led pin
86
#define MY_DEFAULT_RX_LED_PIN 5 // Receive led pin
87
#define MY_DEFAULT_TX_LED_PIN 6 // the PCB, on board LED
88
89
#include <
MySensors.h
>
90
91
void
setup
()
92
{
93
// Setup locally attached sensors
94
}
95
96
void
presentation
()
97
{
98
// Present locally attached sensors
99
}
100
101
void
loop
()
102
{
103
// Send locally attached sensor data here
104
}
loop
void loop()
Main loop.
Definition:
GatewaySerialRS485.ino:101
presentation
void presentation()
Node presentation.
Definition:
GatewaySerialRS485.ino:96
setup
void setup()
Called after node initialises but before main loop.
Definition:
GatewaySerialRS485.ino:91
MySensors.h
API declaration for MySensors.
Copyright (C) 2013-2019 Sensnology AB. Generated by
doxygen
1.8.17