Guest User

Untitled

a guest
May 31st, 2018
453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <TinyWireS.h> //You need this library to upload the sketch on your slave board
  2.  
  3. void setup()
  4. {
  5. TinyWireS.begin(8); //I2C communication
  6. TinyWireS.onRequest(test);
  7. }
  8.  
  9. void loop()
  10. {
  11. TinyWireS_stop_check();
  12. }
  13.  
  14. void test () //Master calls the slave and the latter one send data
  15. {
  16. TinyWireS.send(0);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment