Created
March 9, 2018 02:40
-
-
Save microcontrollershub/445e676140e2cc844a0253e369d56187 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Arduino as Master Code | |
// by Varad Kulkarni <http://www.microcontrollershub.com> | |
// Created 08 March 2018 | |
#include <Wire.h> | |
void setup() | |
{ | |
Wire.begin(); // Initialize Arduino as Master | |
} | |
void loop() | |
{ | |
Wire.beginTransmission(0x40); // Transmit to device #0x40 | |
Wire.write('0'); // Sends one byte as '0' | |
Wire.endTransmission(); // End transmition | |
delay(2000); | |
Wire.beginTransmission(0x40); // Transmit to device #0x40 | |
Wire.write('1'); // Sends one byte as '1' | |
Wire.endTransmission(); // End transmition | |
delay(2000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment