Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Grove-Base Shield and Relay Netduino Plus/Arduino


  • Please log in to reply
3 replies to this topic

#1 aberkley

aberkley

    New Member

  • Members
  • Pip
  • 2 posts

Posted 25 October 2012 - 08:21 PM

Developing relay that is controlled via buttons on website. I notice that relay was ON for Netduino Plus board and it was off for the ardiuno (EtherTen). I am using a Grove Relay that plugs into the Grove-Base shield. Apparently the Netduino Plust I/O pins set to high (3.3V) is there a way to set them to low(turn them off)?

#2 carb

carb

    Advanced Member

  • Members
  • PipPipPip
  • 352 posts
  • LocationCrystal River, Florida

Posted 25 October 2012 - 10:05 PM

Developing relay that is controlled via buttons on website. I notice that relay was ON for Netduino Plus board and it was off for the ardiuno (EtherTen). I am using a Grove Relay that plugs into the Grove-Base shield. Apparently the Netduino Plust I/O pins set to high (3.3V) is there a way to set them to low(turn them off)?

Aberkley,

How do you have the initial pin state? Is it set to false.

Dim led As New OutputPort(Pins.GPIO_PIN_D5, False)

That is for Visual Basic but it similar for C#.

The Netduino may boot with the pin positive but once booted should go to the initial state very quickly. If it doesn't you may be able to add a pull down resistor.

By the way welcome to the forum.

Chuck

#3 aberkley

aberkley

    New Member

  • Members
  • Pip
  • 2 posts

Posted 26 October 2012 - 02:47 PM

Aberkley,

How do you have the initial pin state? Is it set to false.

Dim led As New OutputPort(Pins.GPIO_PIN_D5, False)

That is for Visual Basic but it similar for C#.

The Netduino may boot with the pin positive but once booted should go to the initial state very quickly. If it doesn't you may be able to add a pull down resistor.

By the way welcome to the forum.

Chuck


I do not set the initial pin state. The netduino probably does boot with the pin positive and they stay positive. I believe that it is a software issue I probably need to change a setting in the firmware.

Thank you for the suggestion

#4 carb

carb

    Advanced Member

  • Members
  • PipPipPip
  • 352 posts
  • LocationCrystal River, Florida

Posted 26 October 2012 - 05:16 PM

I do not set the initial pin state. The netduino probably does boot with the pin positive and they stay positive. I believe that it is a software issue I probably need to change a setting in the firmware.

Thank you for the suggestion

Aberkley,

Netduinos use the Digital ports in almost every application.

I wrote the following code to test it on my Netduino classic and it worked fine. With a voltmeter I had 3 milli volts when the button was NOT pushed, 3.3 vdc when the Onboard button is pressed.

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;

namespace Digital_Pin_Test
{
  public class Program
  {
    static OutputPort D1 = new OutputPort(Pins.GPIO_PIN_D1, false);
    static InputPort Button = new InputPort(Pins.ONBOARD_SW1, false,Port.ResistorMode.Disabled);
   
    public static void Main()
    {
      while (true)
      {
        D1.Write(Button.Read());
      }
    }
  }
}
For Visual Basic use:
Imports System
Imports System.Threading
Imports Microsoft.SPOT
Imports Microsoft.SPOT.Hardware
Imports SecretLabs.NETMF.Hardware
Imports SecretLabs.NETMF.Hardware.Netduino

Namespace Digital_Pin_Test
  Public Class Program
    Shared D1 As New OutputPort(Pins.GPIO_PIN_D1, False)
    Shared Button As New InputPort(Pins.ONBOARD_SW1, False, Port.ResistorMode.Disabled)

    Public Shared Sub Main()
      While True
	D1.Write(Button.Read())
      End While
    End Sub
  End Class
End Namespace
Good Luck,
Chuck




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.