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.
![Photo](http://www.gravatar.com/avatar/c6103ce5caf0d4151638d2a4a84dfc1e?s=100&d=http%3A%2F%2Fforums.netduino.com%2Fpublic%2Fstyle_images%2Fmaster%2Fprofile%2Fdefault_large.png)
Measuring Analog Value and output it on console?
Started by darkside40, Nov 14 2010 07:31 PM
3 replies to this topic
#1
Posted 14 November 2010 - 07:31 PM
#2
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
#4
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