Publish your project for free and start receiving offers from freelance contractors in serveral minutes after publication!

Linux (Ubuntu) найти пины у GPIO



Applications 3

Only registered users can view attachments.
  1. 1409    15  0
    2 days600 ₽

    Попробуйте под root'ом:

    echo "1" > /sys/class/gpio/export
    cat /sys/class/gpio/gpio1/direction
    cat /sys/class/gpio/gpio1/value

    echo "2" > /sys/class/gpio/export
    echo in >/sys/class/gpio/gpio2/direction
    cat /sys/class/gpio/gpio2/direction
    cat /sys/class/gpio/gpio2/value

    echo "3" > /sys/class/gpio/export
    echo out >/sys/class/gpio/gpio3/direction
    cat /sys/class/gpio/gpio3/direction
    echo "1" > /sys/class/gpio/gpio3/value
    cat /sys/class/gpio/gpio3/value

    В инструкции:
    https://www.ics.com/blog/gpio-programming-using-sysfs-interface
    пишут, что сначала нужно "экспортировать" пин, чтобы он стал виден в системе.

    Вот ещё инструкции по работе с GPIO:
    https://wirenboard.com/wiki/%D0%A0%D0%B0%D0%B1%D0%BE%D1%82%D0%B0_%D1%81_GPIO
    http://integrator.adior.ru/index.php/orangepi/479-orange-pi-raspberry-gpio-test
    https://theiotlearninginitiative.gitbook.io/embedded-linux/subsystems/general-purpose-input-output