Grove Expansion - .NET Gadgeteer Module

Grove is a modulated, ready-to-use tool set.
Much like Lego, it takes a building block approach to assembling electronics.

Moderators: lily.li, violet, salmanfarisvp, jeremy882, crail.lyu969

Post Reply
mcneillb
Pre-kindergarten
Pre-kindergarten
Posts: 2
Joined: Tue Dec 13, 2011 4:02 pm

Grove Expansion - .NET Gadgeteer Module

Post by mcneillb » Tue Jul 10, 2012 1:42 pm

Does anyone have some working sample code for this module as I'm having trouble getting it to work (I'm using a Grove - Sound Sensor with a Fez Spider board, but have a number of Grove sensors so any samples would be helpful) as it keeps telling me it needs an A socket, and then when I plug it into an A socket, then it tells me it needs an K socket, and then when I plug it into a K socket then it tells me I need an A socket etc. For example the code I'm using is as follows:

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());
 
        }
    }
}
I believe the Grove - Sound Sensor would require a Analog Input but any help would be appreciated.

Thanks

User avatar
deray
Elementary-3
Elementary-3
Posts: 327
Joined: Fri Mar 30, 2012 1:45 pm

Re: Grove Expansion - .NET Gadgeteer Module

Post by deray » Thu Jul 26, 2012 4:27 pm

Hello ;) ,
Very sorry for the late reply , I have upload the schematic file in eagle on the website page .
http://www.seeedstudio.com/depot/grove- ... ?cPath=203

Deray

Post Reply