Grove-Base Shield and Relay Netduino Plus/Arduino
#1
Posted 25 October 2012 - 08:21 PM
#2
Posted 25 October 2012 - 10:05 PM
Aberkley,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)?
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
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
Posted 26 October 2012 - 05:16 PM
Aberkley,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
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 NamespaceGood Luck,
Chuck
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users