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

Can't get digital out to work


  • Please log in to reply
5 replies to this topic

#1 skarphedinnos

skarphedinnos

    Member

  • Members
  • PipPip
  • 26 posts
  • LocationIceland

Posted 30 October 2012 - 04:02 PM

Hi.

static OutputPort D0 = new OutputPort(Cpu.Pin.GPIO_Pin0,false);

while(true)
                                {
                                    D0.Write(true);
                                    D8.Write(true);
                                    D1.Write(false);
                                    Thread.Sleep(5000);
                                    
                                    SensorValue0 = SensorValue0 + A0.Read();
                                    SensorValue1 = SensorValue1 + A1.Read();
                                    //Thread.Sleep(100);
                                    D8.Write(false);
                                    D0.Write(false);
                                    D1.Write(true);
                                    Thread.Sleep(2000);

                                }

The output seems to stay high no matter what.

I have the newest firmware.

I'm probabl missing something super simple.

#2 Paul Newton

Paul Newton

    Advanced Member

  • Members
  • PipPipPip
  • 724 posts
  • LocationBerkshire, UK

Posted 30 October 2012 - 04:18 PM

Hi there,

Its not that obvious:
I think you are using the wrong enumeration for the GPIO pins.
Try Pins.GPIO_PIN_D0 instead of Cpu.Pin.GPIO_Pin0

Hope this helps - Paul

Can't take credit for this, I can never remember what to use.
CW2 posted an example here: forum post

#3 skarphedinnos

skarphedinnos

    Member

  • Members
  • PipPip
  • 26 posts
  • LocationIceland

Posted 30 October 2012 - 04:43 PM

Hi there,

Its not that obvious:
I think you are using the wrong enumeration for the GPIO pins.
Try Pins.GPIO_PIN_D0 instead of Cpu.Pin.GPIO_Pin0

Hope this helps - Paul

Can't take credit for this, I can never remember what to use.
CW2 posted an example here: forum post

That does not work in version 4.2 :/

#4 NooM

NooM

    Advanced Member

  • Members
  • PipPipPip
  • 490 posts
  • LocationAustria

Posted 30 October 2012 - 05:01 PM

make sure you have the SecretLabs.NETMF.Hardware.yournetduinotype reference included. also do using SecretLabs.NETMF.Hardware.yournetduinotype; than you can use Pins.blabla

#5 skarphedinnos

skarphedinnos

    Member

  • Members
  • PipPip
  • 26 posts
  • LocationIceland

Posted 30 October 2012 - 05:17 PM

I have tried all kind of combinations of using SecretLabs.... and Microsoft.... I finally got it to work, but the method was rather strange. I changed the project to F 4.1 and used "pins." (I got two ND 4.1 and 4.2) That didn't work so I changed back to F 4.2 and switched ND again, and :D. There must be some kind of bug that got fixed during this framwork change. Anyways, thanks guys :)

#6 zemuss

zemuss

    Advanced Member

  • Members
  • PipPipPip
  • 69 posts

Posted 30 October 2012 - 08:42 PM

Skar... I am new to the .Net Micro Framework and just new to netduino development all together. What I had to do when upgrading from 4.1 to 4.2 is remove the references then re-add them. It makes sense because the assemblies are in different folders, so if you are using the 4.1 DLLS then the folder path will be C:\Program Files (x86)\Microsoft .NET Micro Framework\4.1. However, if your using 4.2 it will point to the C:\Program Files (x86)\Microsoft .NET Micro Framework\4.2 path. I edited the post because having a DLL folder does not work as expected. I hope this made some sense. "Z"




0 user(s) are reading this topic

0 members, 0 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.