There are some examples of using the ADC component directly in my huge
bolus of code at:   http://www.etantdonnes.com/Motes/robocode.tar.gz
Most likely you have not made the ADC and input so you are converting
the equivalent of a logic 1...

The only special sensorboard stuff is that they switch on internal
sensors (photo,temp) using digital outputs from some specific pins
and then make sure to switch the ADC to the right channel. The code
should work pretty well without the SB attached. You should be able to
connect your input to ADC1 and use the Photo component to get started.

I'm a little confused by your math...basically Vref is the Max voltage
and 0 is the Min. I think it should be   ADC =  (Vin / Vref) * 1024
where 1024 is the maximum reading from a 10 bit converter. Also I believe
Vref is the supply voltage or very near, so 3 volts.

MS


TEAM X wrote:
Hi,

I'm trying to connect some components to the ADC channels on a Mica2. I am not using the Crossbow sensorboards, but all of the code examples I have seen are using this sensorboard. The only ports I have connected are the ADC channel (ADC3) and ground. No matter what voltage I put on the input channel, I get a very large value (>32000) as the input for the ADC. Am I missing something?



Does anyone have an example of code for the ADC that does not use a Crossbow sensorboard?
On a related issue,
ADC=(Vin / 1024) * Vref
Where Vin can be between 0 and (2^6-1)*Vref and Vref is 1.23 V.


Does this really mean that the ADC can take in voltages of up to 80V.  I find 
that hard to believe.

Thanks very much,
Joe


------------------------------------------------------------------------

_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to