I want to use a MAX521 in I2C with my Netduino, I use the class I2CBus found on the forum, but I am having dificulties with the function to write a value to a regitre
here is my code:
using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.Hardware.NetduinoPlus; using NetduinoPlusTesting; namespace Maxdac { public class Maxdacdevice { private I2CDevice.Configuration _slaveConfig; private const int TransactionTimeout = 3000; // ms private const byte ClockRateKHz = 100; public byte Address { get; private set; } public Maxdacdevice(byte address) { Address = address; _slaveConfig = new I2CDevice.Configuration(address, ClockRateKHz); } public void write() { //Send command write Full Power DAC0 I2CBus.GetInstance().Write(_slaveConfig, new byte[] { 0x07 , 0x00 }, TransactionTimeout); I2CBus.GetInstance().Write(_slaveConfig, new byte[] { 0xFF }, TransactionTimeout); } } }
in fact I try to do a translation of an existing library for Arduino, but since I'm a beginner it was not easy for me
The link from the site of the library MAX520 / 1 for Arduino
and the to linkthe documentation of the IC
Sorry for my poor English I use Google to translate if someone could help me it would be super cool!