Skip to content

Ovidiu22/I2C-communication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

I2C-communication

C code demonstrating I2C communication between two Arduino boards (UNO or Nano) using ATmega328P microcontrollers.

The project implements a master-slave setup, where the master reads the state of a button and sends it over I2C to the slave, which displays the button status on a 20×4 LCD display.


Overview

This project provides a simple example of inter-microcontroller communication using the I2C protocol.

  • Master: Reads a button input, sends the button state to the slave, and controls the I2C communication.
  • Slave: Receives the button state and displays the status on a 20×4 LCD as either "Btn. pressed" or "Btn. not pressed".

It is designed for educational purposes and to demonstrate I2C functionality in embedded systems.


Features

  • Master-slave I2C communication
  • Button state reading and transmission
  • Displaying received data on 20×4 LCD
  • Modular and reusable code structure
  • Tested with Arduino UNO / Nano boards

Hardware / Environment

  • Microcontrollers: ATmega328P (Arduino UNO/Nano)
  • Development environment: Atmel Studio
  • Display: LCD 20×4 (HD44780-compatible)
  • Input: Push-button connected to master MCU

Usage

  1. Connect the master and slave boards via I2C (SDA and SCL lines).
  2. Connect a push-button to the master board.
  3. Connect the 20×4 LCD to the slave board using the LCD library.
  4. Load the master code on one board and the slave code on the other.
  5. Press the button on the master board; the slave will display the button state on the LCD.

Refer to the source files for function definitions and configuration details.


Status

✔️ Stable — tested on Arduino UNO/Nano boards with 20×4 LCD.


License

This project is open-source and intended for educational and embedded development use.


Schematics

Schematic

Releases

No releases published

Packages

 
 
 

Contributors