permanently set ADC pins

hey guys,

I’m trying to read some voltages from ADC pins.
I have been using this code to set the pins. echo cape-bone-iio > /sys/devices/bone_capemgr.*/slots
It works, but whenever I restart my BBB, I have to type this code again.

Can I set it permanently?

well I tried this from my c++ code.




using namespace std;

int main() {

system(“echo cape-bone-iio > /sys/devices/bone_capemgr.*/slots”);

return 0;


but it doesnt work

modified uEnv.txt file located in /boot/uboot


didnt work

I am not sure if this helps, but i had a similar requirement to update the slots file after boot and this is how I achieved it:

  1. wrote a .sh script
  2. call the .sh script from cron at reboot.

Contents of
#!/bin/sh -
echo HK-GPIO-Test1 > /sys/devices/bone_capemgr.8/slots

Contents of cron:

root@beaglebone:~# crontab -l
@reboot /home/root/