Giter Club home page Giter Club logo

seeprom's Introduction

Seeprom library

Seeprom is an Arduino library for interfacing to small electrically erasable programmable read-only memories (e.g. the 24Cxx series) on the I2C bus.


How to connect the EEPROM to the Arduino board

The EEPROM must be connected to Arduino by considering the following configuration.

EEPROM Arduino
pin 1 [GND] GND
pin 2 [Vcc] 5v
pin 3 [SDA] Analog pin 4
pin 4 [SCL] Analog pin 5
pin 5 [WP] GND (to not hardware protect data)
pin 6 [A0] GND
pin 7 [A1] GND
pin 8 [A2] GND

List of methods

  • Seeprom(byte devaddr, unsigned length)
  • void writeByte(int epaddr, byte data)
  • void writePage(int epaddr, const byte * data, byte length)
  • int readByte(int epaddr)
  • int readBuffer(int epaddr, byte * buffer, byte length)
  • void dump(int epaddr)
  • void writeInt(int epaddr, int int16)
  • int readInt(int epaddr)
  • void writeLong(int epaddr, long long32)
  • long readLong(int epaddr)
  • void clearPage(int epaddr)
  • void clearAll()

Example

#include <Seeprom.h>

const byte DEVADDR = 0x50; //Address of the EEPROM
Seeprom eeprom(DEVADDR, 2048); //create the eeprom object

value = eeprom.readInt(0); //Read integer from EEPROM at address 0x00
eeprom.writeInt(0,value+2); //Write integer value+2 at the same address

seeprom's People

Contributors

nicopi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.