Skip to content

brookpatten/Mono.Linux.I2C

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mono.Linux.I2C

A lightweight Mono/.Net/C# Wrapper for interacting with i2c devices on linux.

Build Status

be sure that your user/process has access to the relevant device file(s) either through sudo or permissions
hint, if you're running through monodevelop, it probably doesn't

//open i2c bus 1, aka /dev/i2c-1
using (var i2cBus = new I2CBus(0x01))
{
  //create a device at address 0x3c
  var i2cDevice = new I2CDevice(i2cBus, 0x3c);
  var bytes = new byte[2];
  //read 2 bytes starting at register 0x00
  i2cDevice.ReadBytes(0x00, 2, bytes);
  //do someting useful with the bytes
}//note that disposing the bus closes the file

About

A lightweight Mono/.Net/C# Wrapper over i2c for linux. Shamelessly borrowed from https://github.com/cody82/QuadroschrauberSharp and refactored to fit my OOP OCD

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages