Netduino home hardware projects downloads community

Jump to content

The Netduino forums have been replaced by new forums at This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

Differences between micro .net framework 4.1 and 4.2

  • Please log in to reply
2 replies to this topic

#1 tabbetje


    New Member

  • Members
  • Pip
  • 2 posts

Posted 16 September 2012 - 08:03 PM

I'm a new user of the netduino plus board. But, and I think that was not a clever idea, I updated the firmware of my board to micro .net framework 4.2. My board is function very well. But now I'm trying the experiments in the nedx experimenters guide. The experiment for the temperature is using the analog pin 0. In the code this is done by: static AnalogInput tempSensor = new AnalogInput(Pins.GPIO_PIN_A0); But this returns an error: The best overloaded method match for 'Microsoft.SPOT.Hardware.AnalogInput.AnalogInput(Microsoft.SPOT.Hardware.Cpu.AnalogChannel)' has some invalid arguments. So switching to: static AnalogInput tempSensor = new Microsoft.SPOT.Hardware.AnalogInput(Cpu.AnalogChannel.ANALOG_0); But now my tempSensor.Read() return a double instead of an int. Is there a difference between the analoginput in version 4.1 and 4.2?

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 16 September 2012 - 08:46 PM

Hi tabbetje, An AnalogInput class was added into the NETMF core with .NET MF 4.2. You can use this new class (as you have done) and then multiply the value by 1023. You can also add in SecretLabs.NETMF.Hardware.AnalogInput.dll as a reference to your project, and then declare your object with the full class name of SecretLabs.NETMF.Hardware.AnalogInput. That will give you the same object model and int return type as with .NET MF 4.1 (for full backwards compatibility). Chris

#3 tabbetje


    New Member

  • Members
  • Pip
  • 2 posts

Posted 18 September 2012 - 11:28 AM

Chris, thanks a lot.

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.