aboutsummaryrefslogtreecommitdiff
path: root/libraries/Wire/examples/slave_sender
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/Wire/examples/slave_sender')
-rw-r--r--libraries/Wire/examples/slave_sender/slave_sender.ino9
1 files changed, 3 insertions, 6 deletions
diff --git a/libraries/Wire/examples/slave_sender/slave_sender.ino b/libraries/Wire/examples/slave_sender/slave_sender.ino
index 26b9e52..d2e72bb 100644
--- a/libraries/Wire/examples/slave_sender/slave_sender.ino
+++ b/libraries/Wire/examples/slave_sender/slave_sender.ino
@@ -12,21 +12,18 @@
#include <Wire.h>
-void setup()
-{
+void setup() {
Wire.begin(8); // join i2c bus with address #8
Wire.onRequest(requestEvent); // register event
}
-void loop()
-{
+void loop() {
delay(100);
}
// function that executes whenever data is requested by master
// this function is registered as an event, see setup()
-void requestEvent()
-{
+void requestEvent() {
Wire.write("hello "); // respond with message of 6 bytes
// as expected by master
}