Commit d466b5a9 authored by Philip Hozier's avatar Philip Hozier
Browse files

week13 5/5 update #3

parent 34d0bf52
Pipeline #228862 passed with stages
in 21 seconds
......@@ -413,6 +413,23 @@ The idea was to use previous code from my other boards to program LED functions
A different program on the controller would broadcast a 'message' and the nodes would then activate a LED function based on that message.
The main part of the programming would be to find out how to send and receive signals - and then how the receiver board deals with it.
- Include the correct library e.g. Wire (I2C for Arduino)
e.g. #include <Wire.h></Wire.h>
- Start Serial communication
- Join I2C bus
Wire.begin(optional address); // Controller doesn't necessarily need an address
- Transmit
Wire.beginTransmission(node_address); // transmit to a specific node
Wire.write(myMessage); // send bytes
Wire.endTransmission(); // stop transmission
- Receive
Wire.onReceive(recieveEvent); // register event
- Receive
## What I should’ve done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment