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.

zee's Content

There have been 47 items by zee (Search limited from 13-May 23)


By content type

See this member's


Sort by                Order  

#46724 Netduino Plus 2 - AnalogInput & SetRange errors

Posted by zee on 06 March 2013 - 03:38 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi,

 

I am using Netduino Plus 2 and I followed the steps from 'Getting Started with Netduino' pdf on Chapter 5. I encountered few problems on the coding. There are 4 errors. Please help me!

 

 

 

Error 1 The best overloaded method match for 'Microsoft.SPOT.Hardware.AnalogInput.AnalogInput(Microsoft.SPOT.Hardware.Cpu.AnalogChannel)' has some invalid arguments
 
Error 2 Argument 1: cannot convert from 'Microsoft.SPOT.Hardware.Cpu.Pin' to 'Microsoft.SPOT.Hardware.Cpu.AnalogChannel'
 

 

Error 3 'Microsoft.SPOT.Hardware.AnalogInput' does not contain a definition for 'SetRange' and no extension method 'SetRange' accepting a first argument of type 'Microsoft.SPOT.Hardware.AnalogInput' could be found (are you missing a using directive or an assembly reference?)
 
Error 4 Cannot implicitly convert type 'double' to 'int'. An explicit conversion exists (are you missing a cast?)

 

Looking forward to your speedy response. Thank you!




#46745 Netduino Plus 2 - AnalogInput & SetRange errors

Posted by zee on 06 March 2013 - 10:08 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi and welcome to the Netduino forums!

 

The book describes the Netduino API, I think your problem would be fixed if you'd remove the reference to Microsoft.SPOT.Hardware.AnalogInput.dll and add a reference to SecretLabs.NETMF..Hardware.AnalogInput.dll

 

After following your instructions, there are more errors.. Anyway i am new to this Netduino Plus 2.. Could you please explain to me in detail? Thank you.

 

 

Error 1 'AnalogInput' is an ambiguous reference between 'Microsoft.SPOT.Hardware.AnalogInput' and 'SecretLabs.NETMF.Hardware.AnalogInput'
 
Error 2 'AnalogInput' is an ambiguous reference between 'Microsoft.SPOT.Hardware.AnalogInput' and 'SecretLabs.NETMF.Hardware.AnalogInput'
Error 3 The best overloaded method match for 'Microsoft.SPOT.Hardware.AnalogInput.AnalogInput(Microsoft.SPOT.Hardware.Cpu.AnalogChannel)' has some invalid arguments
 
Error 4 Argument 1: cannot convert from 'Microsoft.SPOT.Hardware.Cpu.Pin' to 'Microsoft.SPOT.Hardware.Cpu.AnalogChannel'
 
Error 5 'Microsoft.SPOT.Hardware.AnalogInput' does not contain a definition for 'SetRange' and no extension method 'SetRange' accepting a first argument of type 'Microsoft.SPOT.Hardware.AnalogInput' could be found (are you missing a using directive or an assembly reference?)
 
Error 6 Cannot implicitly convert type 'double' to 'int'. An explicit conversion exists (are you missing a cast?)
 



#46799 Netduino Plus 2 - AnalogInput & SetRange errors

Posted by zee on 07 March 2013 - 12:44 AM in Netduino Plus 2 (and Netduino Plus 1)

Refer to the attached.

 

error on measuring volt.JPG

 

 

 

 




#46809 Netduino Plus 2 - AnalogInput & SetRange errors

Posted by zee on 07 March 2013 - 07:30 AM in Netduino Plus 2 (and Netduino Plus 1)

Problem solved ! Thank you ! :)




#46813 PWM - Deploy Fail

Posted by zee on 07 March 2013 - 09:02 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi,

 

This is my second time try to run this project. Its from the 'Getting Started with Netduino' on Chapter 6, Dimmer Code..I have installed the SecretLabs.NETMF.Hardware.PWM and there is no error in the code. However, when it is running, it states that "unable to communicate with device - USB:Netduino" under the output tab.

There is also a message box pop-up "There were deployment errors. Continue?".

 

 

Please help me !!! Thank you!




#46858 PWM - Deploy Fail

Posted by zee on 08 March 2013 - 12:37 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi.. Thanks for the quick reply.. I did not set any frequency on it.

 

Here are my codes..

 

 

using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
 
namespace Dimmer_PWM
{
    public class Program
    {
        public static void Main()
        {
            // write your code here
 
            SecretLabs.NETMF.Hardware.PWM led = new 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; //store and retrieve the potentiometer's current position
 
            while (true)
            {
                //read the value of the potentiometer
                potValue = pot.Read();
 
                //change the led intensity base on the potentiometer's value (0-100%)
               led.SetDutyCycle((uint) potValue);
                             
            }
 
        }
 
    }
}



#46864 Error: No response from device (HELP!!!)

Posted by zee on 08 March 2013 - 02:04 AM in General Discussion

Hi Black Rose, When you power on your Netduino Plus, does the blue LED go out after a few seconds (indicating that it has booted)? If so, try to erase your current Netduino app: 1. Unplug your Netduino Plus and all components 2. Open up MFDeploy on your computer, select USB transport 3. Hold down the pushbutton on your Netduino Plus. This will force it into bootloader mode. 4. Connect your Netduino Plus to your PC (and keep holding the button). 5. Within 2 seconds, press the ERASE button in MFDeploy. Does that fix things for you? Also...after that, I'd recommend upgrading to the lasest firmware (v4.1.0.6 or v4.1.1 alpha 7+). Chris

 

 

Hi Chris,

 

I have the same problem too, after ive upgraded the firmware to 4.2,2. But when plugged into the USB, the LED is not blinking. However there is an error message saying that "There were deployment error. Continue?" and error output message " Unable to communicate with device - USB:Netduino"..

 

I encountered this problem before. The first was i need to change the hardware. So,i am afraid if the problem i faced is similar like before.

 

Your help is kindly appreciated! :)




#46873 Error: No response from device (HELP!!!)

Posted by zee on 08 March 2013 - 07:27 AM in General Discussion

Hi Chris,

 

I managed to solve the problem. Yup,thanks for the help Chris! :)




#46998 Beginner needs Help with Netduino & PIR Motion Detection!

Posted by zee on 11 March 2013 - 01:56 AM in General Discussion

Doh!!! - I assumed the black was the ground wire but you are right! It now works.. Thanks alot for your info. Excellent stuff. I have also cleaned up the code and removed references to EnableInterrupt() and ClearInterrupt()

 

 

Hi Waxie,

 

You mind pasting your codes here?

 

I am actually wondering how do you test your device, is there anything around your sensor device? It is because when i try to test, i placed the device in a box and still the outcome stated 'Motion detected'.

 

 And,when u test the program does the outcome stated Motion Detected even though we did not hover above the device? 




#46999 Yet another supported shield question (GPS)

Posted by zee on 11 March 2013 - 03:04 AM in Netduino 2 (and Netduino 1)

P.S.

Here's some very rough test code I put together to make sure we were getting data from the GPS receiver. You might want to put this in an event handler-based class which parsed the data out and raised events whenever a new location was received.

But this will show you your GPS data stream Posted Image I've put a 100ms delay in between each iteration of the loop so that we're not getting and printing one byte of data at a time.

I plugged TX, RX, and PWR into pins D0, D1, and D2. This corresponds to serial port 1 (COM1) and a "powerpin" of D2.
 

using System;using System.IO.Ports;using System.Threading;using Microsoft.SPOT;using Microsoft.SPOT.Hardware;using SecretLabs.NETMF.Hardware;using SecretLabs.NETMF.Hardware.Netduino;namespace GpsLogger{    public class Program    {        public static void Main()        {            // write your code here            SerialPort serialPort = new SerialPort("COM1", 4800, Parity.None, 8, StopBits.One);            serialPort.Open();            // pin D2 off = gps module turned on            OutputPort powerPin = new OutputPort(Pins.GPIO_PIN_D2, false);            while (true)            {                int bytesToRead = serialPort.BytesToRead;                if (bytesToRead > 0)                {                    // get the waiting data                    byte[] buffer = new byte[bytesToRead];                    serialPort.Read(buffer, 0, buffer.Length);                    // print out our received data                    Debug.Print(new String(System.Text.Encoding.UTF8.GetChars(buffer)));                }                Thread.Sleep(100); // wait a bit so we get a few bytes at a time...            }        }    }}

 

Hi Chris,

 

May i know what will be the output like?

There's no error but im just wondering how will the output like?

Sorry for my noob question. Im soooo new to this sensor device.. :)




#47008 Netduino Plus 2 - AnalogInput & SetRange errors

Posted by zee on 11 March 2013 - 05:55 AM in Netduino Plus 2 (and Netduino Plus 1)

How was the problem solved? I'm facing the exact same problem now.

 

number 6 seems to be just a matter of changing int potValue=0; to double potValue=0;

 

 

I include the SecretLabs.NETMF.Hardware.AnalogInput command infront & add reference 'SecretLabs.NETMF.Hardware.AnalogInput..

 

eg:

SecretLabs.NETMF.Hardware.AnalogInput pot = new SecretLabs.NETMF.Hardware.AnalogInput(Pins.GPIO_PIN_A0);




#47063 mscorlib.dll error

Posted by zee on 12 March 2013 - 07:06 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi,

 

I got an error when deploy piezo. An error message box pop up "An unhandled exception of type 'System.Exception' occurred in mscorlib.dll".. Can anyone please help me where is the problem?




#47069 mscorlib.dll error

Posted by zee on 12 March 2013 - 08:58 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi Stefan,

 

Here's the code below:

 

 

 

public static void Main()
{
// write your code here
 
// store the notes on the music scale and their associated pulse lengths
System.Collections.Hashtable scale = new System.Collections.Hashtable();
 
// low octave
scale.Add("c", 1915u);
scale.Add("d", 1700u);
scale.Add("e", 1519u);
scale.Add("f", 1432u);
scale.Add("g", 1275u);
scale.Add("a", 1136u);
scale.Add("b", 1014u);
 
// high octave
scale.Add("C", 956u);
scale.Add("D", 851u);
scale.Add("E", 758u);
 
// silence ("hold note")
scale.Add("h", 0u);
 
int beatsPerMinute = 90;
int beatTimeInMilliseconds =
60000 / beatsPerMinute; // 60,000 milliseconds per minute
int pauseTimeInMilliseconds = (int)(beatTimeInMilliseconds * 0.1);
 
// define the song (letter of note followed by length of note)
string song = "C1C1C1g1a1a1g2E1E1D1D1C2";
 
// define the speaker
PWM speaker = new PWM(Pins.GPIO_PIN_D5);
 
// interpret and play the song
for (int i = 0; i < song.Length; i += 2)
{
// extract each note and its length in beats
string note = song.Substring(i, 1);
int beatCount = int.Parse(song.Substring(i + 1, 1));
 
// look up the note duration (in microseconds)
uint noteDuration = (uint)scale[note];
 
// play the note for the desired number of beats
speaker.SetPulse(noteDuration * 2, noteDuration);
Thread.Sleep(
beatTimeInMilliseconds * beatCount - pauseTimeInMilliseconds);
 
// pause for 1/10th of a beat in between every note.
speaker.SetDutyCycle(0);
Thread.Sleep(pauseTimeInMilliseconds);
 
}
 
Thread.Sleep(Timeout.Infinite);
}
 
 
 
Thanks for your help! :)



#47070 mscorlib.dll error

Posted by zee on 12 March 2013 - 09:07 AM in Netduino Plus 2 (and Netduino Plus 1)

Sorry.. the PWM i editted it to SecretLabs.NETMF.Hardware.PWM speaker = new SecretLabs.NETMF.Hardware.PWM(Pins.GPIO_PIN_D5);




#47071 mscorlib.dll error

Posted by zee on 12 March 2013 - 09:17 AM in Netduino Plus 2 (and Netduino Plus 1)

Sorry Stefan.. My typo error.. Instead of 'i', I accidentally typed '1'..

 

instead of :

 

string note = song.Substring(i, 1);
int beatCount = int.Parse(song.Substring(i + 1, 1));
 
 My silly mistakes:
string note = song.Substring(1, 1);
int beatCount = int.Parse(song.Substring(1 + 1, 1));

 

Sorry for the Inconveniences cause..




#47168 Piezo sensor

Posted by zee on 14 March 2013 - 02:57 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi..

 

I need help here! I am doing a project for drum with led lights up upon hit the piezo. Can arduino codes be used for netduino plus 2? Researching since just now and the results are all for arduino uno.




#47215 PWM - Deploy Fail

Posted by zee on 15 March 2013 - 03:37 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi zee, The code looks fine at first glance. Let's check out the other variables... What board are you using? Netduino? Netduino Plus 2? When you open up project properties, and then go to the .NET MF tab...do you see your Netduino in the device pulldown? When deployment fails, go to the Output tab in Visual Studio. If it shows more information about what failed during deployment, please post that info here. Chris

 

Hi Chris,

 

Thanx for the response..

 

I am using Netduino Plus 2.. Yes, there is Netduino in the device pulldown.. 

The error in the output tab, stated "Unable to communicate with device - USB:Netduino"..




#47216 Piezo on Netduino ?

Posted by zee on 15 March 2013 - 03:46 AM in General Discussion

Hi,

 

I need help here.. I am now doing a project for drum using piezo & led.. I have been researching for it for almost a week, but the results seem to be only for Arduino Uno. I could not find any help on the codes for Netduino Plus 2. Is there any codes that is similar to this project?




#47578 ToggleButton sample

Posted by zee on 26 March 2013 - 01:20 AM in Project Showcase

Hi Dab,

 

Is there any way that piezo speaker can be on/off too upon pressing the toggle button? I have a project to do, where song will be play through piezo if the button is been press & led on, and the song will be stop when the button been press again & led off.




#47614 ToggleButton sample

Posted by zee on 27 March 2013 - 02:39 AM in Project Showcase

Put your song code in a separate thread.  Start and stop the thread using the button toggle code.

 

Hi Dave,

 

You mind explain to me the steps? I am soooo noob in this netduino. Really new to me. Is it add new class or add new project?

I did tried to add both, but received few errors. Putting them in a different project, no errors but how to link? Add class, received lots of errors.

Appreciate your help :)




#47615 ToggleButton sample

Posted by zee on 27 March 2013 - 05:17 AM in Project Showcase

Program.cs 

 

 

using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
using System.IO.Ports;
using System.Text;
 
namespace PushButton_OutputMusic
{
    public class Program
    {
        private static SecretLabs.NETMF.Hardware.PWM speaker = new SecretLabs.NETMF.Hardware.PWM(Pins.GPIO_PIN_D5);
 
        static System.Collections.Hashtable scale = new System.Collections.Hashtable();
 
        public static void Main()
        {
 
            while (true)
            {
                GetSound();
             
            }
        }
 
        private static void GetSound()
        {
             
            //low octave
            scale.Add("c", 1915u);
            scale.Add("d", 1700u);
            scale.Add("e", 1519u);
            scale.Add("f", 1432u);
            scale.Add("g", 1275u);
            scale.Add("a", 1136u);
            scale.Add("b", 1014u);
 
            // high octave
            scale.Add("C", 956u);
            scale.Add("D", 851u);
            scale.Add("E", 758u);
            scale.Add("F", 191u);
            scale.Add("G", 170u);
            scale.Add("A", 153u);
            scale.Add("B", 136u);
            scale.Add("C2", 127u);
 
            // silence ("hold note")
            scale.Add("h", 0u);
 
            int beatsPerMinute = 90;
            int beatTimeInMilliseconds = 60000 / beatsPerMinute; //60,000 milliseconds per minute
            int pauseTimeInMilliseconds = (int)(beatTimeInMilliseconds * 0.1);
 
            string song = "C1C1C1g1a1a1g2E1E1D1D1C2h"; //old macdonald
            song += "C1C1G1G1A1A1G2F1F1E1E1D1D1C2h"; //twinkle little star
 
            while (true)
            {
 
                for (int i = 0; i < song.Length; i += 2)
                {
                    //song loop
 
                    string note = song.Substring(i, 1); 
                    int beatCount = int.Parse(song.Substring(i + 1, 1)); 
 
                    uint noteDuration = (uint)scale[note];
 
                    speaker.SetPulse(noteDuration * 2, noteDuration); 
 
                    Thread.Sleep(beatTimeInMilliseconds * beatCount - pauseTimeInMilliseconds);
 
                    speaker.SetDutyCycle(0); //set to 0, turn the piezo off momentarily
                    Thread.Sleep(pauseTimeInMilliseconds);
 
                } 
 
               Thread.Sleep(1000);
 
            }
        }
 
     
    }
}

 

Next, Button.cs

 

using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
 
namespace PushButton_OutputMusic
{
    class Button
    {
        InterruptPort button;
        OutputPort led;
        bool ledState;
 
        public void buttonToggle()
        {
        ledState = true;
 
            led = new OutputPort(Pins.ONBOARD_LED, ledState);
            button = new InterruptPort(Pins.ONBOARD_SW1, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeLow);
 
            //bind the interrupt handler to the pin's interrupt event
            button.OnInterrupt += new NativeEventHandler(SwitchInterruptHandler);
 
            while (true)
            {
 
                Thread.Sleep(Timeout.Infinite);
             
            } 
        }
 
        public void SwitchInterruptHandler(UInt32 data1, UInt32 data2, DateTime time)
        {
 
            button.DisableInterrupt();
 
            //invert the previous state of the LED
            ledState = !ledState; 
 
            //set the LED to its new state
            led.Write(ledState);
 
            button.EnableInterrupt();
        }
    }
}

 

 

Is this correct? The song auto play after i deploy. Then i pressed the button, the song stop and it starts automatically in few seconds. My objective is to make the song start and stop when pressing the button on Netduino..




#47869 ToggleButton sample

Posted by zee on 01 April 2013 - 03:25 AM in Project Showcase

Hi zee, Your button class isn't being used in your main program, so the button is acting as a software reset button (its default state). Chris

 

 

Hi Chris,

 

But it works as it stopped the song and continue it automatically after few seconds. Could you guide me how should i put the Button class in Program.cs? Is it supposed to be in 2 different classes as shown above or all in one class?




#48056 Oz-Solutions Tutorial: RGB LED

Posted by zee on 05 April 2013 - 03:32 AM in Netduino 2 (and Netduino 1)

Hi..

 

I have a problem with the LED color. I am still unsure what is the problem. After typed out all the codes with no error and run the program, the red LED did not even light up at all, the green LED color is so little which hardly to see it, and the blue LED is so bright. I used 100 ohm resistor on red, 105 ohm resistor on green and 250 ohm variable resistor on blue. I have try to swap the resistor but the outcome is still the same. Could anyone please guide me what is the problem here? :(




#48165 Honeywell HIH-4030 Humidity Sensor

Posted by zee on 08 April 2013 - 02:01 AM in Project Showcase

Hi phantomtypist

 

I had a Humidity Sensor - HIH 4030 and decided to try it out for my research lab. Unfortunately, i faced with an error on this ( 'HumiditySensor.HIH4030._sensor' is never assigned to, and will always have its default value null ) I did change some of the code into SecretLabs. The red font is the error i am facing. Could you tell me what is the problem.

 

 

public class HIH4030 : IDisposable
    {
[color=#ff0000;]        private SecretLabs.NETMF.Hardware.AnalogInput _sensor;[/color]
        private bool _disposed;
 
        protected virtual void Dispose(bool disposing)
        {
            // Check if Dipose has already been called.
            if (!_disposed)
            {
                if (disposing)
                {
                    _sensor.Dispose();
                    _disposed = true;
                }
            }
        }
 
        ~HIH4030()
        {
            Dispose(false);
        }
 
        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this); // tell the GC not to finalize.
        }
 
        public HIH4030(Cpu.Pin analogPin)
        {
            SecretLabs.NETMF.Hardware.AnalogInput _sensor = new SecretLabs.NETMF.Hardware.AnalogInput(analogPin);
            _sensor.SetRange(0, 3300);
        }
 
        /// <summary>
        /// Calculates the relative humidity with temperature compensation.
        /// </summary>
        /// <param name="temp">Current temperature in Celsius.</param>
        /// <returns>Returns the relative humidity as a percentage.</returns>
        public double RelativeHumidity(float temp)
        {
            // Get the humidity sensor reading.
            int sensorReading = _sensor.Read();
 
            // Calculate the humidity sensor voltage.
            double sensorVoltage = (((double)sensorReading / 3300) * 3.3);
 
            // Define the voltage the sensor returns at 0% humidity.
            double zeroVoltage = 0.528;
 
            /* It has been observed that some sensors are consistently 
             * inaccurate and off by a certain voltage than what they 
             * should be.  Use this variable to compensate for what the 
             * voltage should be if needed. */
            double calibrationVoltage = 0.00;
 
            /* Determine the maxium voltage of the sensor with 
                temperature compensation. */
            double maxVoltage = (2.1582 - (0.004426 * temp));
 
            /* Determine the temperature compensated relative humidity 
                as a percentage. */
            double rh = ((sensorVoltage + calibrationVoltage - zeroVoltage) / maxVoltage) * 100;
 
            return rh;
        }
 
Thanks!

This is code for the Honeywell HIH-4030 humidity sensor (SparkFun SKU: SEN-09569).

Please note that the sensor is supposed to be used with 5v input, but it works just fine with 3.3v input because the output is linear.

The code below is tailored to 3.3v input.
 

    /// <summary>    /// Honeywell HIH-4030 humidity sensor (SEN-09569).     /// Please note that the sensor is supposed to be used with 5v input,     /// but it works just fine with 3.3v input because the output is linear.    /// The code below is tailored to 3.3v input.    /// </summary>    public class HIH4030 : IDisposable    {        private AnalogInput _sensor;        private bool _disposed;        protected virtual void Dispose(bool disposing)        {            // Check if Dipose has already been called.            if (!_disposed)            {                if (disposing)                {                    _sensor.Dispose();                    _disposed = true;                }            }        }        ~HIH4030()        {            Dispose(false);        }        public void Dispose()        {            Dispose(true);            GC.SuppressFinalize(this); // tell the GC not to finalize.        }        public HIH4030(Cpu.Pin analogPin)        {            _sensor = new AnalogInput(analogPin);            _sensor.SetRange(0, 3300);        }        /// <summary>        /// Calculates the relative humidity with temperature compensation.        /// </summary>        /// <param name="temp">Current temperature in Celsius.</param>        /// <returns>Returns the relative humidity as a percentage.</returns>        public double RelativeHumidity(float temp)        {            // Get the humidity sensor reading.            int sensorReading = _sensor.Read();            // Calculate the humidity sensor voltage.            double sensorVoltage = (((double)sensorReading / 3300) * 3.3);            // Define the voltage the sensor returns at 0% humidity.            double zeroVoltage = 0.528;            /* It has been observed that some sensors are consistently              * inaccurate and off by a certain voltage than what they              * should be.  Use this variable to compensate for what the              * voltage should be if needed. */            double calibrationVoltage = 0.00;            /* Determine the maxium voltage of the sensor with                 temperature compensation. */            double maxVoltage = (2.1582 - (0.004426 * temp));            /* Determine the temperature compensated relative humidity                 as a percentage. */            double rh = ((sensorVoltage + calibrationVoltage - zeroVoltage) / maxVoltage) * 100;                        return rh;        }            }



#48166 Oz-Solutions Tutorial: RGB LED

Posted by zee on 08 April 2013 - 02:02 AM in Netduino 2 (and Netduino 1)

You are correct in that the resistors will vary for different color LEDs but they can also vary for different types of LEDs.  What RGB LED are you using?  May need to look at the specs and recalculate the resistors.  Additionally what power source are you using? 3v? 5v? 12v? and are the LEDs common cathode or common anode?

 

I am using the RGB Diffused Common Cathode [https://www.sparkfun.com/products/9264]. I did not connect any power source when running the program. I did the same thing as the diagram given. Is my resistor value correct? Connect to red with resistor of brown, black, brown, gold. Connect to green with resistor of brown, black, green, gold. Connect to blue with 250 ohm variable resistor. I have another resistor i have not try which is red, black, orange, gold.

 

Your guidance are really appreciated :)





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.