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