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.

Don King

Member Since 01 Aug 2012
Offline Last Active Aug 15 2013 08:28 AM
-----

Topics I've Started

Are there any known issues with SD cards?

29 March 2013 - 08:35 PM

Are there any known issues with this release and SD cards? I am having a lot of issues with code that worked fine for me in the past (recompiled with the latest .NETMF 4.3 and Netduino 4.3 SDK and using VS 2012 on an NP2). I keep having issues with corrupt files, files that won't write out and then once is a while it seems to work fine but mostly it fails. Below is the simple code I am using to create the file and then the code that I use to append records. My card is a 2GB SanDisk. The behavior has been very strange. I can provide detail if it will help.

 

 

 

using (var filestream = new FileStream(@"SDMY_LED_LOG.CSV", FileMode.Create)){  StreamWriter streamWriter = new StreamWriter(filestream);  streamWriter.WriteLine("Status,DateTime");  streamWriter.Close();} 

 

 

 

 

using (var filestream = new FileStream(@"SDMY_LED_LOG.CSV", FileMode.Append)){ StreamWriter streamWriter = new StreamWriter(filestream); streamWriter.WriteLine(statusText + "," + DateTime.Now.ToString()); streamWriter.Close();} 

Prototype works! Now what?

29 March 2013 - 03:38 PM

I have finished my first successful prototype and now want to make it a permanent one. If I understand what I have read on the forums correctly, I should be able to use a MakerShield to solder things to permanently and then place it on top of my NP2?

 

Any help, advice, tips, tricks etc. are very welcome. My project is a OneWire temperature probe and so I am certain there are "helper" devices that would allow me to have quick connect and disconnect of components? (e.g. if I don't want the temperature probe to be soldered permanently, I can have something soldered that it can connect to).

 

I appreciate any feedback. This community has been extremely helpful to newbies like me just learning electronics. I hope I can pay it back some day :).

 

Thanks!

 

Don

 

Attached File  NP2_TempPrototype_DK.jpg   131.6KB   40 downloads


Help with DS18B20 and basic electronics

30 August 2012 - 02:33 AM

Hi All - Sorry for the elementary questions on electronics. I am a .NET Developer who is just getting started using micro-controllers, specifically the Netduino Plus. I have been running through many examples, learning basics with the .NETMF, learning to flash upgrded software etc. I have literally no experience with wiring and such except for the wire I put in the 3.3v hookup and touched the gold erase pad. That's it.

Now that you know my electronics level, on to the questions...

I want to use the DS18B20 Temperature Sensor that I bought from Sparkfun. The technician gave me a little verbal layout of the wiring:


Sensor-------->Netduino Plus
-GND(black wire)----GND
-VDD(red wire) ----3.3V
-DQ(white wire)---Digital Pin on the Netduino

She also mentioned putting a 4.7 pull up resistor between the signal and power pin. I actually sort of follow what she is saying after reading a couple of things online and some information from a Netduino book. I feel like I need another piece like a breadboard (no idea which one to get) and some jumper wires. I purchased a pack of resisitors and so I am good there. It appears that wiring this thing directly to the Netduino Plus is either impractical, ill-advised or both. I have seen a few postings on this subject with pictures posted on how someone has wired it up although I am not certain what I am looking at.

Any direction on that is appreciated. I did run through a breadboard tutorial to which another user posted a link but I was wary because the tutorial was hard to understand and the comments seemed to dispute the authors calculation of resitance provided by X number of resistors. The last thing I want to do is burn up some hardware (obviously).

Additonally, I have questions about OneWire support. I have read through several posts trying to figure out where that support effort currently is for the Netduino. I have thus far noted the following:

1. A gentleman named CW2 has produced a very nice implementation of OneWire support. There was talk of including it in the official release but that did not come to fruition.

2. The Microsoft .NETMF 4.2 has OneWire support in the Microsoft.SPOT.Hardware.OneWire assembly.

3. At this point in time, if I want to use the DS18B20 Temperature Sensor I need one wire support and will need to flash the modified (unsupported?) version created as a special build and includes CW2's implementation. My understanding is that the Secret Labs SDK would need to include a Netduino Plus specific implementation for whichever (CW2 or Microsoft.SPOT.Hardware.OneWire) to use this device.

If I have misstated anything above please do correct me. All of this is my next big step in understanding the basics of how to get this sensor to work properly for my project.

I thank you very much for taking your time to read this and certainly with any help you can provide.

Regards,

Don

Issue with resolving AnalogInput

29 August 2012 - 11:48 PM

I hope this is the right place to post this. Please let me know otherwise.

I am a .NET Developer but a newbie to micro-controllers and electronics. I have been going through the samples and reading through two books, one of which is Getting Started with the Internet of Things. I am sure that others here are familiar with this. The code below has an issue that I cannot seem to get resolved. When I search the forum I see it mentioned but it seems to be pre release of .NETMF 4.2. The issue is marked below with a comment. I cannot get the 'AnalogInput' class to resolve except through the Microsoft.SPOT.Hardware namespace at which time it wants a type of Cpu.AnalogChannel as an argument. I have tried 'Cpu.AnalogChannel.ANALOG_1' as the argument for this code but it does not work. I am somewhat lost.

I have connected a potentiometer to the Analog In (Pins 0, 1 and 2) but when I run the application the voltage always reads out as 0.00 so either I don't have it hooked up correctly or my code is wrong. I am guessing the latter.

I have seen previous postings where it is mentioned that you should use 'SecretLabs.NETMF.Hardware.AnalogInput' but I am not seeing that class exist. I do notice however that if I use:

var voltagePort = new Microsoft.SPOT.Hardware.AnalogInput(Cpu.AnalogChannel.ANALOG_0);

and then try to declare:

var lowPort = new OutputPort(Pins.GPIO_PIN_A0, false);

I get an error as if the first declaration took the resource on the board and is having a conflict. That makes me think that my code is actually correct and I don't know what I am doing with the potentiometer (that is highly likely).

Below is my current code taken from the book with my mods:

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

public class VoltageReader
{
    public static void Main()
    {
        const double maxVoltage = 3.3;
        const int maxAdcValue = 1023;

        //var voltagePort = new AnalogInput(Pins.GPIO_PIN_A1); //THIS HAS AN ISSUE RESOLVING
        var voltagePort = new Microsoft.SPOT.Hardware.AnalogInput(Cpu.AnalogChannel.ANALOG_1); //REPLACED LINE WITH THIS
        var lowPort = new OutputPort(Pins.GPIO_PIN_A0, false);
        var highPort = new OutputPort(Pins.GPIO_PIN_A2, true);

        while (true)
        {
            int rawValue = voltagePort.Read();
            double value = (rawValue * maxVoltage) / maxAdcValue;
            Debug.Print(rawValue + "  " + value.ToString("f"));
            Thread.Sleep(3000);                     // 3 seconds
        }
    }
}
Any help is appreciate to point me in the right direction.

Thanks!

Don

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.