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.

andersborg

Member Since 12 Feb 2011
Offline Last Active Oct 29 2013 10:27 PM
-----

Topics I've Started

4.2 and out of memory

21 August 2012 - 08:45 AM

Several different topics, but hopefully the answers don't have to be elaborate.

It says "netduino go (and all 4.2 upgrades)" on the download page, and Plus is not mentioned. So should I not upgrade to .NET Framework 4.2 and SDK 4.2 if I have a Plus?

I also wonder if there's new released firmware, as I've been looking for 1-Wire support that was discussed in the forum some time ago. I now have 4.1.1.0.

I upgraded to .NET 4.2 and SDK 4.2 (anyhow) and there's a weird problem with possibly garbage collect. If I run this with a Thread.Sleep of 10 or 100 doesn't matter. It will anyway get out of memory after a rather short while. If I add a Debug.print it will not. Isn't memory management performed during Thread.Sleep?

Sadly below is the only way I've found to switch meaning of different ports. This should not have been handled as instances, for memory and performance reasons. Is there a way to address the ports and port configuration more directly?

The code:
public static bool scan(out int X, out int Y)
    {
        analog1 = new AnalogInput(X2);
        analog2 = new AnalogInput(X1);
        digital1 = new OutputPort(Y1, false);
        digital2 = new OutputPort(Y2, true);

        int valueX = analog1.Read();
        X = adapt(valueX);

        analog1.Dispose();
        analog2.Dispose();
        digital1.Dispose();
        digital2.Dispose();

        analog1 = new AnalogInput(Y1);
        analog2 = new AnalogInput(Y2);
        digital1 = new OutputPort(X2, false);
        digital2 = new OutputPort(X1, true);

        int valueY = analog2.Read();
        Y = adapt((range - 1) - valueY);

        analog1.Dispose();
        analog2.Dispose();
        digital1.Dispose();
        digital2.Dispose();

        analog1 = null;
        analog2 = null;
        digital1 = null;
        digital2 = null;

        return valueX != range - 1 && valueY != range - 1;
    }

Cheers,
Anders

Sending SMSs from a Netduino

19 September 2011 - 08:39 PM

Here's a Netduino magically sending SMSs without there being any phone connected to it. The blog entry explains how. http://abiro.com/w/2...ased-on-events/ Cheers, Anders

Instantiations when switching mode

08 September 2011 - 06:38 AM

I'm working on communicating with a DS18B20 temperature sensor, and part of the example code in Wiring I found in Practical Arduino looks like this: digitalWrite(Pin, LOW); pinMode(Pin, OUTPUT); delayMicroseconds(5); pinMode(Pin, INPUT); delayMicroseconds(60); If I understand correctly, when using the Netduino class library I need to re-instantiate for every new setting of pin mode. Am I right? If so, this is bad design, as generally instantiations for such a simple and very repetitive task should be avoided on a resource-constrained platform like Netduino (and in general). Doing so is extremely "expensive" compared to just switching mode via a static method implemented in Assembly. Has it been considered to not require instantiation when switching modes, including between analog and digital? Cheers, Anders

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.