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

Measuring Analog Value and output it on console?


  • Please log in to reply
3 replies to this topic

#1 darkside40

darkside40

    Member

  • Members
  • PipPip
  • 18 posts

Posted 14 November 2010 - 07:31 PM

Hi there, is there anyway to output the measured AnalogInput value to a console on my PC? I want to use a potentiometer to adjust the Thread.Sleep so i can control the blinky speed of my LED. But it would also be usefull in General to know how to output the values of the Netduino Pins on Console.

#2 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 14 November 2010 - 07:50 PM

Hi there,
is there anyway to output the measured AnalogInput value to a console on my PC?

I want to use a potentiometer to adjust the Thread.Sleep so i can control the blinky speed of my LED.

But it would also be usefull in General to know how to output the values of the Netduino Pins on Console.



            AnalogInput pot = new AnalogInput(Pins.GPIO_PIN_A0);

            pot.SetRange(50, 1000); // Optional. (min, max) min wait 5 millisecs, max 1 sec

            int currentVal = pot.Read();

            Debug.Print(currentVal.ToString()); // Print to VS Debug Window
            Thread.Sleep(currentVal); // sleep for that time.

That should do. Please note that it is going to send the values to the Visual Studio Output Window.

Hope that helps

#3 bill.french

bill.french

    Advanced Member

  • Members
  • PipPipPip
  • 260 posts
  • LocationPrinceton, NJ

Posted 15 November 2010 - 12:04 AM

This might help you: http://forums.netdui...it-and-program/

#4 darkside40

darkside40

    Member

  • Members
  • PipPip
  • 18 posts

Posted 15 November 2010 - 05:42 AM

Thanks for the Quick answers, and yes it helps, especially the Debug.print instruction was something important i had not known till now.




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.