Code: Select all
The problem I'm having is when I plug it into port 10 which is a A port I get:
An unhandled exception of type 'Gadgeteer.Socket.InvalidSocketException' occurred in Gadgeteer.dll
Additional information: Module GroveExpansion cannot use socket 10 because it requires a socket supporting type 'K'
But when I plug it into say port 4 which is a K port I get:
An unhandled exception of type 'Gadgeteer.Socket.InvalidSocketException' occurred in Gadgeteer.dll
Additional information: Socket 4 does not support type 'A' required by GroveExpansion module, so you can see its rather messed up.
Here is the code I'm trying to get running.
[code]
using Microsoft.SPOT;
using GT = Gadgeteer;
using GTI = Gadgeteer.Interfaces;
namespace GroveTest1
{
public partial class Program
{
private GTI.AnalogInput _input;
void ProgramStarted()
{
_input = groveExpansion.SetupAnlogInput(GT.Socket.Pin.Three);
GT.Timer _timer = new GT.Timer(500);
_timer.Tick += new GT.Timer.TickEventHandler(_timer_Tick);
_timer.Start();
}
void _timer_Tick(GT.Timer timer)
{
Debug.Print("tick");
double volts = _input.ReadVoltage();
double proportion = _input.ReadProportion();
Debug.Print("volts: " + volts.ToString());
Debug.Print("proportion: " + proportion.ToString());
}
}
}
Thanks