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

SD card logger


  • Please log in to reply
4 replies to this topic

#1 Zeus

Zeus

    New Member

  • Members
  • Pip
  • 8 posts
  • LocationIsrael

Posted 25 February 2012 - 04:55 PM

Hello guys,
I am new to Netduino, though I recently bought Netduino Plus.
I am trying to build a small project where I need to log some analog sensor data and date-time in a csv file on SD card.
Here is a small code which I wrote for CO sensor.

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
using System.IO;
using Ethernet.Data;


namespace co
{
    public class Program
    {
        public static void Main()
        {
            // write your code here
            AnalogInput coSensor = new AnalogInput(Pins.GPIO_PIN_A0);
            coSensor.SetRange(0, 1024);
            while (true)
            {
                Debug.Print(coSensor.Read().ToString());
            Thread.Sleep(1000);
        }

        }

    }
}

Please help me log it on SD card.

Thanks.

Z

#2 Llaves

Llaves

    New Member

  • Members
  • Pip
  • 9 posts

Posted 25 February 2012 - 05:38 PM

Check out my post here. While it's focused on 1-wire devices, it contains the code I used to log data to an SD card.

#3 Zeus

Zeus

    New Member

  • Members
  • Pip
  • 8 posts
  • LocationIsrael

Posted 26 February 2012 - 01:45 AM

Check out my post here. While it's focused on 1-wire devices, it contains the code I used to log data to an SD card.


Thanks Llaves.
I am trying to get your project work for my need.
I will get back to you shortly.

Z

#4 mekros

mekros

    New Member

  • Members
  • Pip
  • 7 posts

Posted 27 February 2012 - 11:28 PM

N+ has no inbuilt time date functionality. I've got the code written up to do datalogging into a CSV (.txt) that I have to integrate into my code I'm tinkering with.

#5 Teets

Teets

    Member

  • Members
  • PipPip
  • 16 posts

Posted 28 February 2012 - 02:14 AM

using System.IO;

...

public void Write(string filePath, string message)
{
    using(StreamWriter writer = new StreamWriter(filePath))
    {
        writer.WriteLine(message);
        writer.Flush();
    }
}

...

Hello guys,
I am new to Netduino, though I recently bought Netduino Plus.
I am trying to build a small project where I need to log some analog sensor data and date-time in a csv file on SD card.
Here is a small code which I wrote for CO sensor.

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
using System.IO;
using Ethernet.Data;


namespace co
{
    public class Program
    {
        public static void Main()
        {
            // write your code here
            AnalogInput coSensor = new AnalogInput(Pins.GPIO_PIN_A0);
            coSensor.SetRange(0, 1024);
            while (true)
            {
                Debug.Print(coSensor.Read().ToString());
            Thread.Sleep(1000);
        }

        }

    }
}

Please help me log it on SD card.

Thanks.

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.