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!
Looking forward to your speedy response. Thank you!
  | ||||||||||||||
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 ContentThere have been 47 items by zee (Search limited from 13-May 23) #46724 Netduino Plus 2 - AnalogInput & SetRange errorsPosted 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 errorsPosted by zee on 06 March 2013 - 10:08 AM in Netduino Plus 2 (and Netduino Plus 1)
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 errorsPosted by zee on 07 March 2013 - 12:44 AM in Netduino Plus 2 (and Netduino Plus 1) #46809 Netduino Plus 2 - AnalogInput & SetRange errorsPosted by zee on 07 March 2013 - 07:30 AM in Netduino Plus 2 (and Netduino Plus 1) Problem solved ! Thank you ! #46813 PWM - Deploy FailPosted 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 FailPosted 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 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
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)
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 errorsPosted by zee on 11 March 2013 - 05:55 AM in Netduino Plus 2 (and Netduino Plus 1)
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 errorPosted 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 errorPosted 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 errorPosted 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 errorPosted 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 sensorPosted 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 FailPosted by zee on 15 March 2013 - 03:37 AM in Netduino Plus 2 (and Netduino Plus 1)
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 samplePosted 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 samplePosted by zee on 27 March 2013 - 02:39 AM in Project Showcase
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 samplePosted by zee on 27 March 2013 - 05:17 AM in Project Showcase
Next, Button.cs
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 samplePosted by zee on 01 April 2013 - 03:25 AM in Project Showcase
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 LEDPosted 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 SensorPosted 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!
#48166 Oz-Solutions Tutorial: RGB LEDPosted by zee on 08 April 2013 - 02:02 AM in Netduino 2 (and Netduino 1)
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
| ||||||||||||||
|
||||||||||||||
This webpage is licensed under a Creative Commons Attribution-ShareAlike License. | ||||||||||||||