Skip to content

Commit

Permalink
Add NODE_NUMBER define
Browse files Browse the repository at this point in the history
  • Loading branch information
ethomas997 committed Apr 8, 2018
1 parent 47a3573 commit 5acb403
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 3 additions & 5 deletions doc/Hardware and Software Setup Instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,10 @@ Note: The latest Arduino IDE (1.8+) is required from https://www.arduino.cc/en/M

Open '/delta5_race_timer/src/delta5node/delta5node.ino' in the Arduino IDE.

Configure the '#define i2cSlaveAddress' line of the .ino for each node before uploading.
Configure the '#define NODE_NUMBER' line of the .ino for each node before uploading. For first node set NODE_NUMBER to 1, for second set it to 2, etc.
```
// Node Setup -- Set the i2c address here
// Node 1 = 8, Node 2 = 10, Node 3 = 12, Node 4 = 14
// Node 5 = 16, Node 6 = 18, Node 7 = 20, Node 8 = 22
#define i2cSlaveAddress 8
// Node Setup -- Set node number here (1 - 8)
#define NODE_NUMBER 1
```

### System (Raspberry Pi)
Expand Down
7 changes: 5 additions & 2 deletions src/delta5node/delta5node.ino
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@

#include <Wire.h>

// Node Setup -- Set the i2c address here
// Node Setup -- Set node number here (1 - 8)
#define NODE_NUMBER 1

// i2c address for node
// Node 1 = 8, Node 2 = 10, Node 3 = 12, Node 4 = 14
// Node 5 = 16, Node 6 = 18, Node 7 = 20, Node 8 = 22
#define i2cSlaveAddress 8
#define i2cSlaveAddress (6 + (NODE_NUMBER * 2))

const int slaveSelectPin = 10; // Setup data pins for rx5808 comms
const int spiDataPin = 11;
Expand Down

0 comments on commit 5acb403

Please sign in to comment.