Hi guys,
I am really new here and need help!
I want to use Seeed Modules, but they don´t appear in the VS Toolbox. I installed everything like its on Support/Netfm
Vs2012 Express
4.3(QFE1) Micro Framework
.NET Gadgeteer core
NETFM & Gadgeteer Package 2014 R5
I am using Win8
i want to use the moisture sensor v1.1 module by seeed studios with my FEZ cerberus!
I installed the discontinued modules but same problem. when i launch the toolbox there are only GHI Electronics modules in there. but i want the seeed modules too
It’s a very simple module. I’ve converted the original code to 4.3 but cannot test it as I don’t have this module.
using System;
using Microsoft.SPOT;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using GTI = Gadgeteer.SocketInterfaces;
namespace Gadgeteer.Modules.Seeed
{
/// <summary>
/// A MoistureSensor module for Microsoft .NET Gadgeteer
/// </summary>
public class MoistureSensor : GTM.Module
{
GTI.AnalogInput analogInput;
GTI.DigitalOutput digitalOutput;
// Note: A constructor summary is auto-generated by the doc builder.
/// <summary></summary>
/// <param name="socketNumber">The socket that this module is plugged in to.</param>
/// <param name="socketNumberTwo">The second socket that this module is plugged in to.</param>
public MoistureSensor(int socketNumber)
{
// This finds the Socket instance from the user-specified socket number.
// This will generate user-friendly error messages if the socket is invalid.
// If there is more than one socket on this module, then instead of "null" for the last parameter,
// put text that identifies the socket to the user (e.g. "S" if there is a socket type S)
Socket socket = Socket.GetSocket(socketNumber, true, this, null);
socket.EnsureTypeIsSupported(new char[] { 'A' }, null);
analogInput = GTI.AnalogInputFactory.Create(socket, Socket.Pin.Three, this);
digitalOutput = GTI.DigitalOutputFactory.Create(socket, Socket.Pin.Six, true, this);
}
/// <summary>
/// Gets the current moisture reading.
/// </summary>
/// <returns>An integer value, where 0 is fully dry and 1000 (or greater) is completely wet. </returns>
public int GetMoistureReading()
{
return (int)(analogInput.ReadProportion() * 1600.0);
}
/// <summary>
/// Enables or disables the measurement abilities of the sensor. The sensor is enabled by default.
/// </summary>
public bool Enabled
{
get
{
return digitalOutput.Read();
}
set
{
digitalOutput.Write(value);
}
}
}
}
thx for the coding but my VS2012 underlines every "socket"
Error List:
ErrorThe type or namespace name ‘Socket’ could not be found (are you missing a using directive or an assembly reference?
Error The name ‘Socket’ does not exist in the current context