Read analog inputs BBB running Debian Jessie

I’m new to the beagle bone and am having difficulty reading the output of a thumb joystick.

I’m running Debian Jessie 8.2
Linux kernel 4.1.12-ti-r29

I’ve connected the thumb joystick as follows

vcc - p9_32
gnd - p9_34
hor - p9_36
ver - p9_38

i did not connect the pin for the switch because it is not needed.

All the instructions that I can find on the topic suggest that you have to enable the analog inputs on the BBB. The instructions for doing so require using “cape-bone-iio”. I’ve read that cape-bone or bone-cape isn’t the way things are done on linux kernels in the “4.x” range.

So my question is, how do I get the joystick output on my BBB running Debian 8.2 and Kernel 4.1?

Any help is greatly appreciated.
Thanks.

sudo sh -c "echo BB-ADC' > /sys/devices/platform/bone_capemgr/slots"

Regards,

obvious copy/paste error:

sudo sh -c "echo 'BB-ADC' > /sys/devices/platform/bone_capemgr/slots"

Regards,

That has definitely gotten me one step closer, thank you.

After using that command i typed

cat /sys/devices/platform/bone_capemgr/slots
and got this result
0: PF---- -1
1: PF---- -1
2: PF---- -1
3: PF---- -1
4: P-O-L- 0 Override Board Name,00A0,Override Manuf,cape-universaln
5: P-O-L- 1 Override Board Name,00A0,Override Manuf,BB-ADC

Now the next step in the instructions that i’ve found says that I should search the /sys/ directory for files with “ain” in the name
find /sys/ -iname “ain*”

this results in 0 files being found.

I guess the newer kernels don’t use “ain” files for reporting the inputs. Once again my googlefu has failed to return a useful result.

Anyone have any ideas on where exactly I find the data coming in the inputs?

Thanks in advance for any advice.

Right after I posted the last question I found the answer.

this command
cat /sys/bus/iio/devices/iio:device0/in_voltage5_raw

got me the values from the AIN5 (p9.36)

Problem solved.

Thanks! This was a big help. I now have analogRead() working on BoneScript for Jessie.

–Mark