Hello all. I have a question about the dimmer project in chapter 6 of Getting Started with Netduino.
When I run my code it is deployed successfully yet when I turn the potentiometer there is no change in the intensity of the led. I've checked my code, set my deployment target correctly, selected the correct Target framework to no avail. Am I overlooking something? Any guidance would be greatly appreciated.
Hardware: Netduino Plus
Framework: .Net Micro Framework 4.2
Code:
using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
namespace Dimmer
{
public class Program
{
public static void Main()
{
SecretLabs.NETMF.Hardware.PWM led = SecretLabs.NETMF.Hardware.PWM(Pins.GPIO_PIN_D5);
SecretLabs.NETMF.Hardware.AnalogInput pot = new SecretLabs.NETMF.Hardware.AnalogInput(Pins.GPIO_PIN_A0);
pot.SetRange(0, 100);
int potValue = 0;
while (true)
{
potValue = pot.Read();
led.SetDutyCycle((uint) potValue);
}
}
}
}