/sys/devices/ocp.3/helper.12/AIN0 returns the string '587'. In you C code you are reading first two characters, '5' and '8', whose ASCII codes are 0x38 and 0x35. You are collating them as an integer, whose value indeed turns out to be 14389 (printf %x 14389 returns 3835).
You could use formatted reading (fscanf()), if you don't care for speed; or google the way to get binary data from the ADC -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
