Greetings all,
I am seeking some guidense. I am testing a 3 Axis accelerometer breakout board ( http://www.freescale.com/files/sensors/doc/data_sheet/MMA7260QT.pdf ) . How I am understand it is (I maybe be wrong) that the X-Axis, Y-Axis and Z-Axis are analogue.
I have tried to connect them to Pins AnalogIn.Pin.Ain0 , AnalogIn.Pin.Ain1 , AnalogIn.Pin.Ain2 (xbee pins available on SV1) . But keep getting
An unhandled exception of type ‘System.NotSupportedException’ occurred in GHIElectronics.NETMF.Hardware.dll
Where am i going wrong?
Hardware:
Chipwork version 4.1.8.0
Tinyboot version 4.1.6.0
Here is my short code before that i get the exception:
using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using Microsoft.SPOT.IO;
using GHIElectronics.NETMF.Hardware;
using GHIElectronics.NETMF.IO;
using GHIElectronics.NETMF.System;
using Diagnose.Debug;
namespace InternalSensors
{
public class Accelerometer3Axis : InternalSensorsBase
{
#region Pins
private AnalogIn Xaxis;
private AnalogIn Yaxis;
private AnalogIn Zaxis;
private OutputPort CS1Select;
private OutputPort CS2Select;
#endregion
/// <summary>
/// Initialise
/// </summary>
public Accelerometer3Axis()
{
Xaxis = new AnalogIn(AnalogIn.Pin.Ain0); // Exception here
Yaxis = new AnalogIn(AnalogIn.Pin.Ain1); // Exception here
Zaxis = new AnalogIn(AnalogIn.Pin.Ain2); // Exception here
// 1.5g = CS1 false CS2 false
// 2g = CS1 true CS2 false
// 4g = CS1 false CS2 true
// 6g = CS1 true CS2 true
CS1Select = new OutputPort(AccelerometerAssignedPins.GS1, false);
CS2Select = new OutputPort(AccelerometerAssignedPins.GS2, false);
}
public void Run()
{
while (true)
{
Thread.Sleep(500);
}
}
/// <summary>
/// Dispose/release pins
/// </summary>
public override void Dispose()
{
Xaxis.Dispose();
Yaxis.Dispose();
Zaxis.Dispose();
CS1Select.Dispose();
CS2Select.Dispose();
}
}
}
Many Thanks