MySensors Library & Examples  2.3.2
GatewaySerial.ino
1 
39 // Enable debug prints to serial monitor
40 #define MY_DEBUG
41 
42 
43 // Enable and select radio type attached
44 #define MY_RADIO_RF24
45 //#define MY_RADIO_NRF5_ESB
46 //#define MY_RADIO_RFM69
47 //#define MY_RADIO_RFM95
48 
49 // Set LOW transmit power level as default, if you have an amplified NRF-module and
50 // power your radio separately with a good regulator you can turn up PA level.
51 #define MY_RF24_PA_LEVEL RF24_PA_LOW
52 
53 // Enable serial gateway
54 #define MY_GATEWAY_SERIAL
55 
56 // Define a lower baud rate for Arduinos running on 8 MHz (Arduino Pro Mini 3.3V & SenseBender)
57 #if F_CPU == 8000000L
58 #define MY_BAUD_RATE 38400
59 #endif
60 
61 // Enable inclusion mode
62 #define MY_INCLUSION_MODE_FEATURE
63 // Enable Inclusion mode button on gateway
64 //#define MY_INCLUSION_BUTTON_FEATURE
65 
66 // Inverses behavior of inclusion button (if using external pullup)
67 //#define MY_INCLUSION_BUTTON_EXTERNAL_PULLUP
68 
69 // Set inclusion mode duration (in seconds)
70 #define MY_INCLUSION_MODE_DURATION 60
71 // Digital pin used for inclusion mode button
72 //#define MY_INCLUSION_MODE_BUTTON_PIN 3
73 
74 // Set blinking period
75 #define MY_DEFAULT_LED_BLINK_PERIOD 300
76 
77 // Inverses the behavior of leds
78 //#define MY_WITH_LEDS_BLINKING_INVERSE
79 
80 // Flash leds on rx/tx/err
81 // Uncomment to override default HW configurations
82 //#define MY_DEFAULT_ERR_LED_PIN 4 // Error led pin
83 //#define MY_DEFAULT_RX_LED_PIN 6 // Receive led pin
84 //#define MY_DEFAULT_TX_LED_PIN 5 // the PCB, on board LED
85 
86 #include <MySensors.h>
87 
88 void setup()
89 {
90  // Setup locally attached sensors
91 }
92 
94 {
95  // Present locally attached sensors
96 }
97 
98 void loop()
99 {
100  // Send locally attached sensor data here
101 }
loop
void loop()
Main loop.
Definition: GatewaySerial.ino:98
presentation
void presentation()
Node presentation.
Definition: GatewaySerial.ino:93
setup
void setup()
Called after node initialises but before main loop.
Definition: GatewaySerial.ino:88
MySensors.h
API declaration for MySensors.