Following is my code.I'm having an unhandled exception.
Please let me know what's is problem.
using System; using System.Net; using System.Net.Sockets; using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Hardware; using SecretLabs.NETMF.Hardware; using SecretLabs.NETMF.Hardware.NetduinoPlus; namespace i2c { public class Program { public static void Main() { // write your code here byte[] buffer = new byte[10] ; I2CDevice.Configuration config = new I2CDevice.Configuration(0xD0,100); I2CDevice dev = new I2CDevice(config); I2CDevice.I2CWriteTransaction write = I2CDevice.CreateWriteTransaction(new byte[1] { 0 }); I2CDevice.I2CReadTransaction read = I2CDevice.CreateReadTransaction(buffer); I2CDevice.I2CTransaction[] actions = new I2CDevice.I2CTransaction[] { write, read }; dev.Execute(actions, 1000); Debug.Print(buffer[0].ToString()); } } }