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

Analog Input in Firmware 4.2.0.1


  • Please log in to reply
4 replies to this topic

#1 mohammad

mohammad

    Advanced Member

  • Members
  • PipPipPip
  • 79 posts

Posted 14 March 2013 - 05:11 PM

Hi everyone,

 

I have a Netduino Plus and a TMP36 temperature sensor.

My code already worked perfect with firmware 4.1:

using System;using System.Net;using System.Net.Sockets;using System.Threading;using Microsoft.SPOT;using Microsoft.SPOT.Hardware;using SecretLabs.NETMF.Hardware;using SecretLabs.NETMF.Hardware.NetduinoPlus;namespace TemperatureSensorTest{    public class Program    {        public static void Main()        {            //Temperature sensor                       var voltagePort = new AnalogInput(Pins.GPIO_PIN_A1);            var lowPort = new OutputPort(Pins.GPIO_PIN_A0, false);            var highPort = new OutputPort(Pins.GPIO_PIN_A2, true);                       double rawValue = voltagePort.Read();            double result = ((rawValue - 0.5) * 1000) / 10;            Debug.Print("Result: " + result);        }    }}

Now, it doesn't work with my new firmware. Would you please let me find a solution for this problem?

 

Thanks in advance,

Mohammad



#2 mohammad

mohammad

    Advanced Member

  • Members
  • PipPipPip
  • 79 posts

Posted 14 March 2013 - 06:03 PM

It might be useful: http://forums.netdui...nal-to-digital/



#3 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 14 March 2013 - 06:13 PM

Can you tell us more?  Saying "it doesn't work with my new firmware" is very vague.  What part does not work? Does it not get a reading?  Is the temperature incorrect?



#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 14 March 2013 - 06:49 PM

Also, I'm just guessing here, but with .NET Micro Framework 4.2 there are new "AnalogInput" classes. So you'll want to be sure to pull in "SecretLabs.NETMF.Hardware.AnalogInput.dll" as a reference in your project. And then type "SecretLabs.NETMF.Hardware.AnalogInput" instead of just "AnalogInput" when you create your class instances. Chris

#5 mohammad

mohammad

    Advanced Member

  • Members
  • PipPipPip
  • 79 posts

Posted 16 April 2013 - 08:15 PM

Hi Dave and Chris,

 

The problem was solved by the aforementioned link in my second post in this thread (http://forums.netdui...nal-to-digital/). So, thanks for your attention to my problem.

 

Cheers,

Mohammad






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.