Main Site Documentation

Cerb Bee - Analog Input 0


How do you read the input value from the Cerb Bee’s Analog 0? (PB1). When I read, the values keep changing constantly as though the pin is floating (but it is not floating)


What device/sensor are you reading? Are you sure you have stable input signal to begin with?


Yes, the input is stable. It is a potentiometer.


Is it in 0-3.3 range?


The values? Nope they were in some crazy long decimal value. The value is supposed to be between 0 and 1


the voltage - is the voltage under 3.3v ?


Yes the voltage is under 3.3


So this is my code:

Microsoft.SPOT.Hardware.AnalogInput _a0 = new Microsoft.SPOT.Hardware.AnalogInput(Cpu.AnalogChannel.ANALOG_0); 


Crazy long values are ok for ReadRaw. Read method will do what you want as long as the properties are set correctly. Check SDK documentation the formula is there. And this was discussed very recently on the forum as well.


FEZCerbuino.Pin.AnalogIn.A0 Found it. Thanks much