Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NODE_NUMBER define #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -56,12 +56,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