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!
  | ||||||||||||||
Netduino Plus 2 - AnalogInput & SetRange errors
Started by zee, Mar 06 2013 03:38 AM
7 replies to this topic
#1Posted 06 March 2013 - 03:38 AM 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! #2Posted 06 March 2013 - 08:03 AM 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
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs #3Posted 06 March 2013 - 10:08 AM
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?) #4Posted 06 March 2013 - 10:10 AM Error 1 to 5 are probably because you only added the secretlabs reference but didn't remove the microsoft.spot.hardware.analoginput reference. Now it has both options, which the IDE can't work with.
Error 6: without code it's difficult to help you out there!
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs #5Posted 07 March 2013 - 12:44 AM #6Posted 07 March 2013 - 07:30 AM Problem solved ! Thank you ! #7Posted 11 March 2013 - 03:26 AM 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; #8Posted 11 March 2013 - 05:55 AM
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); 1 user(s) are reading this topic0 members, 1 guests, 0 anonymous users | ||||||||||||||
|
||||||||||||||
This webpage is licensed under a Creative Commons Attribution-ShareAlike License. | ||||||||||||||