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.

Geancarlo2

Member Since 21 Feb 2012
Offline Last Active Private
-----

Posts I've Made

In Topic: static bool

06 December 2012 - 02:23 AM

These two methods are not equivalent. The last one only Reads once. Did you mean something like this instead, which is definitely way too verbose?


I think you missed the last line inside the loop since you tried to assign a bool to a delegate :P

In Topic: microcontroller

04 December 2012 - 06:40 PM

...

"like" B)

In Topic: Any ETAs for Netduino Plus 2 Fixes?

30 November 2012 - 12:55 AM

So get a shot of reality here, Chris last post was just 6 days ago...

/irony?

The issue at hand is no word from anyone representing "Secret Labs", it makes people uneasy. It is a really bad course of action given the state of NP2.

In Topic: Encryption on Netduino Plus

29 November 2012 - 02:20 PM

If performance is not an issue, you can adapt from http://code.google.c...Packets/Xtea.cs or the public domain implementation found on wikipedia. I'm sure you can find other c# implementations that don't use unsafe code too.

In Topic: static bool

29 November 2012 - 01:45 PM

The way that is coded it checks only once. To get the behaviour you want(check on each iteration):

public static void Method_6()
        {
            while (phcontroller.Read() && method_state_6)
            {
                ph.Write(false);
                Thread.Sleep(1 * SecondMs);
                ph.Write(true);
                Thread.Sleep(5 * MinuteMs);

            }
}

or +verbose:
public static void Method_6()
        {
            while (phcontroller.Read()==true && method_state_6 == true)
            {
                ph.Write(false);
                Thread.Sleep(1 * SecondMs);
                ph.Write(true);
                Thread.Sleep(5 * MinuteMs);

            }
}

or ++(really unnecessary)verbose:
public static void Method_6()
        {
            bool phState = phcontroller.Read();
            while (phState == true && method_state_6 == true)
            {
                ph.Write(false);
                Thread.Sleep(1 * SecondMs);
                ph.Write(true);
                Thread.Sleep(5 * MinuteMs);
                phState = phcontroller.Read();
            }
}

To be honest, I think you should study a good c# book before moving forward with your project... your questions are language/logic related. Don't let the difficulties discourage you, gather more knowledge and when you succeed it'll be even more gratifying.

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.