Internet Of Things Sensors
CtrlK
  • Cover
  • Summary
  • About This Training
    • Objectives
    • Skills
    • Prerequisites
    • Requirements
  • Once Upon a Time ...
  • Introduction
    • Topologies
    • Data Compression
  • Communication Protocols
    • I2C
      • Linux
      • Arduino
    • Serial Peripheral Interface
    • Serial Communication
      • Laboratory
        • Arduino and Linux
    • Infrared
    • Pulse Width Modulation
  • Microsystems Technologies
    • Actuators
    • Sensors
    • Transducers
  • Layers of Abstraction
    • Intel® IoT Developer Kit Libraries
      • MRAA
      • UPM
      • Laboratory
      • Contributions
    • Linux I2C Device Interface
      • LCD RGB Color Display
      • LCD RGB Text
      • LCD RGB Display Off
      • Temperature
    • Linux I2C Subsystem
  • Data Engines
    • Sparkfun
  • Wrap-Up
    • Online Training
    • Challenge
  • References
  • Sandbox
Powered by GitBook
On this page
  • Arduino
  • Arduino 101
  • Master Mode
  • Slave Mode
  1. Communication Protocols
  2. I2C

Arduino

Arduino

Arduino 101

Master Mode

#include <Wire.h>

void setup() {
  Wire.begin();
  Serial.begin(9600);
}

void loop() {
  Wire.requestFrom(20, 6);

  while (Wire.available()) {
    char c = Wire.read();
    Serial.print(c);
  }

  delay(500);
}

Slave Mode

  • Arduino 101: No I2C Slave mode support in wire.h

PreviousLinuxNextSerial Peripheral Interface

Last updated 7 years ago