|
6 | 6 | * Barduino 2015
|
7 | 7 | */
|
8 | 8 |
|
| 9 | +#include <MySigningNone.h> |
| 10 | +#include <MyTransportRFM69.h> |
| 11 | +#include <MyTransportNRF24.h> |
| 12 | +#include <MyHwATMega328.h> |
| 13 | +#include <MySigningAtsha204Soft.h> |
| 14 | +#include <MySigningAtsha204.h> |
| 15 | + |
9 | 16 | #include <SPI.h>
|
10 | 17 | #include <MySensor.h>
|
| 18 | +#include <MyMessage.h> |
11 | 19 |
|
12 |
| -// SPI Pins |
13 |
| -#define CE_PIN 9 |
14 |
| -#define CS_PIN 10 |
| 20 | +#define RADIO_ERROR_LED_PIN 4 // Error led pin |
| 21 | +#define RADIO_RX_LED_PIN 6 // Receive led pin |
| 22 | +#define RADIO_TX_LED_PIN 5 // the PCB, on board LED |
15 | 23 |
|
16 | 24 | // Wait times
|
17 | 25 | #define LONG_WAIT 500
|
|
30 | 38 | ////#define ID_S_ARDUINO_NODE //auto defined in initialization
|
31 | 39 | ////#define ID_S_ARDUINO_REPEATER_NODE //auto defined in initialization
|
32 | 40 |
|
33 |
| -//#define ID_S_DOOR 1 |
| 41 | +// Some of these ID's have not been updated for v1.5. Uncommenting too many of them |
| 42 | +// will make the sketch too large for a pro mini's memory so it's probably best to try |
| 43 | +// one at a time. |
| 44 | +#define ID_S_DOOR 1 |
34 | 45 | //#define ID_S_MOTION 2
|
35 | 46 | //#define ID_S_SMOKE 3
|
36 | 47 | //#define ID_S_LIGHT 4
|
|
43 | 54 | //#define ID_S_RAIN 11
|
44 | 55 | //#define ID_S_UV 12
|
45 | 56 | //#define ID_S_WEIGHT 13
|
46 |
| -#define ID_S_POWER 14 |
47 |
| -#define ID_S_HEATER 15 |
48 |
| -#define ID_S_DISTANCE 16 |
49 |
| -#define ID_S_LIGHT_LEVEL 17 |
50 |
| -#define ID_S_LOCK 18 |
51 |
| -#define ID_S_IR 19 |
52 |
| -#define ID_S_WATER 20 |
53 |
| -#define ID_S_AIR_QUALITY 21 |
54 |
| -#define ID_S_DUST 22 |
55 |
| -#define ID_S_SCENE_CONTROLLER 23 |
56 |
| - |
57 |
| -#define ID_S_CUSTOM 24 |
| 57 | +//#define ID_S_POWER 14 |
| 58 | +//#define ID_S_HEATER 15 |
| 59 | +//#define ID_S_DISTANCE 16 |
| 60 | +//#define ID_S_LIGHT_LEVEL 17 |
| 61 | +//#define ID_S_LOCK 18 |
| 62 | +//#define ID_S_IR 19 |
| 63 | +//#define ID_S_WATER 20 |
| 64 | +//#define ID_S_AIR_QUALITY 21 |
| 65 | +//#define ID_S_DUST 22 |
| 66 | +//#define ID_S_SCENE_CONTROLLER 23 |
| 67 | +//#define ID_S_CUSTOM 24 |
58 | 68 |
|
59 | 69 | // Global Vars
|
60 | 70 | unsigned long SLEEP_TIME = 60000; // Sleep time between reads (in milliseconds)
|
61 | 71 | boolean metric = true;
|
62 | 72 | long randNumber;
|
63 | 73 |
|
64 | 74 | // Instanciate MySersors Gateway
|
65 |
| -MySensor gw(CE_PIN,CS_PIN); |
| 75 | +MyTransportNRF24 transport(RF24_CE_PIN, RF24_CS_PIN, RF24_PA_LEVEL_GW); |
| 76 | +//MyTransportRFM69 transport; |
| 77 | + |
| 78 | +// Message signing driver (signer needed if MY_SIGNING_FEATURE is turned on in MyConfig.h) |
| 79 | +//MySigningNone signer; |
| 80 | +//MySigningAtsha204Soft signer; |
| 81 | +//MySigningAtsha204 signer; |
| 82 | + |
| 83 | +// Hardware profile |
| 84 | +MyHwATMega328 hw; |
| 85 | + |
| 86 | +// Construct MySensors library (signer needed if MY_SIGNING_FEATURE is turned on in MyConfig.h) |
| 87 | +// To use LEDs blinking, uncomment WITH_LEDS_BLINKING in MyConfig.h |
| 88 | +#ifdef WITH_LEDS_BLINKING |
| 89 | +MySensor gw(transport, hw /*, signer*/, RADIO_RX_LED_PIN, RADIO_TX_LED_PIN, RADIO_ERROR_LED_PIN); |
| 90 | +#else |
| 91 | +MySensor gw(transport, hw /*, signer*/); |
| 92 | +#endif |
66 | 93 |
|
67 | 94 | //Instanciate Messages objects
|
68 | 95 |
|
|
0 commit comments