Hello. This is my first question to the forum. I don’t have much experience with Domino and the NETMF, so I hope this question hasn’t been asked too many times before.
I’m trying to use the I2C example from pages 82 & 83 of the Beginners Guide (dated August 11, 2010) as the basis for talking to an I2C relative humidity sensor. I haven’t gotten to the point where I have to sort out dealing with the sensor yet, so this is a kind of general I2C question.
The code is shown below …
using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using System.Threading;
namespace FEZ_Domino_Application1
{
public class Program
{
public static void Main()
{
// Create I2C object
I2CDevice.Configuration con = new I2CDevice.Configuration(0x40, 400);
I2CDevice MyI2C = new I2CDevice(con);
// Create transactions (we need 2 in this example)
I2CDevice.I2CTransaction[] xActions = new I2CDevice.I2CTransaction[2];
// Create write buffer (we need one byte)
byte[] RegisterNum = new byte[1] { 2 };
xActions[0] = MyI2C.
Thread.Sleep(Timeout.Infinite);
}
}
}
Also, I should point out I’m using MS NETMF 4.1 SDK and GHI NETMF SDK 4.1 with Visual Studio/C# 2010 …
The problem is the line of code xActions[0] = MyI2C … When I type the “.” following MyI2C, CreateWriteTransaction (or for that matter, CreateReadTransaction) isn’t one of the choices.
I’ve looked at the netMF SDK documentation … I’ve included “using Microsoft.SPOT.Hardware;” … and I have added the Microsoft.SPOT.Hardware assembly in the references. I’ve also looked at some of the discussions of I2C in the forum. I’m starting to get really confused now … I’m probably overlooking something really obvious … any ideas?
Thanks,
Al