Main Site Documentation

Cerb Bee - Analog Input 0


#1

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)


#2

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


#3

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


#4

Is it in 0-3.3 range?


#5

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


#6

the voltage - is the voltage under 3.3v ?


#7

Yes the voltage is under 3.3


#8

So this is my code:

Microsoft.SPOT.Hardware.AnalogInput _a0 = new Microsoft.SPOT.Hardware.AnalogInput(Cpu.AnalogChannel.ANALOG_0); 
Debug.Print(_a0.ReadRaw().ToString());


#9

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.


#10

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