Hi Gents,
I have Cerbuino Bee and I was reading an analog input successfully from (A0) using:
var analogInput = new Microsoft.SPOT.Hardware.AnalogInput(GHI.OSHW.Hardware.FEZCerbuino.Pin.AnalogIn.A0);
But when I want to use the analog input in Socket #3, so I changed it to:
var analogInput = new Microsoft.SPOT.Hardware.AnalogInput(GHI.OSHW.Hardware.FEZCerbuino.Pin.Gadgeteer.Socket3.Pin3);
it gives me some errors:
[em]Error 2 Argument 1: cannot convert from ‘Microsoft.SPOT.Hardware.Cpu.Pin’ to 'Microsoft.SPOT.Hardware.Cpu.AnalogChannel’
Error 1 The best overloaded method match for ‘Microsoft.SPOT.Hardware.AnalogInput.AnalogInput(Microsoft.SPOT.Hardware.Cpu.AnalogChannel)’
[/em]
I was trying to cast it using:
var analogInput = new Microsoft.SPOT.Hardware.AnalogInput((Microsoft.SPOT.Hardware.Cpu.AnalogChannel)GHI.OSHW.Hardware.FEZCerbuino.Pin.Gadgeteer.Socket3.Pin3);
The error gone, no errors now but it gives me run-time exception!!
[em]Exception performing Timer operation
A first chance exception of type ‘System.ArgumentException’ occurred in Microsoft.SPOT.Hardware.dll
[/em]
All what I need right now is to read an analog input from Socket #3, any idea?
Regards