Welcome
Guest
, you are in:
<root>
•
Login
Netduino Wiki
Navigation
¶
Main Page
Random Page
Create a new Page
All Pages
Categories
Navigation Paths
File Management
Create Account
Search the wiki
»
Back
GO! Module - Potentiometer
Modified on 2012/06/04 01:06
by
Nevyn
Categorized as
Netduino GO!
,
Netduino GO! Modules
The netduino GO! potentiometer module has a single potentiometer. Here is a quick video I ([http://forums.netduino.com/index.php?/user/111-omar-oz/|Omar]) made to show what can be done with it and how: <iframe width="640" height="360" src="https://www.youtube-nocookie.com/embed/_ef-DqyXaTc?rel=0" frameborder="0" allowfullscreen></iframe> '''Sample Code:''' @@using Microsoft.SPOT; namespace Module_Tests { public class Program { public static void Main() { NetduinoGo.RgbLed led = new NetduinoGo.RgbLed(); NetduinoGo.Potentiometer pot = new NetduinoGo.Potentiometer(); // pot.GetValue() - Returns a float from 0 to 1. while (true) { led.SetColor(0, 0, (byte)(pot.GetValue() * 255)); } } } }@@ Code with method to set a custom range: @@using Microsoft.SPOT; namespace Module_Tests { public class Program { public static void Main() { NetduinoGo.RgbLed led = new NetduinoGo.RgbLed(); NetduinoGo.Potentiometer pot = new NetduinoGo.Potentiometer(); while (true) { led.SetColor(0, 0, (byte)(Map(pot.GetValue(), 0, 1, 0, 255))); } } // Used for mapping range of values to another range, linearly. public static float Map(float input, float inMin, float inMax, float outMin, float outMax) { return ((input - inMin) * (outMax - outMin) / (inMax - inMin) + outMin); } } }@@ ''' ''' '''Where to buy:''' * [http://www.amazon.com/dp/B007P2OGOW/|Amazon] * [http://nwazet.com/potentiometer/|nwazet] ===='''Design and NETMF Source Files are attached!'''====
Meta Keywords:
netduino GO!, netduino GO! module, potentiometer, potentiometer module
Meta Description:
This is a netduino GO! potentiometer module.
Change Comment:
ScrewTurn Wiki
version 3.0.4.560. Some of the icons created by
FamFamFam
.