Changes

Jump to: navigation, search

Fitlet GPIO usage manual in Linux environment

182 bytes removed, 13:14, 19 June 2019
* It provides instructions to install the dkms kernel module to enable GPIO functionality.
=='''Instructions:'''Installation == $ wget https://fit-iot.com/files/download/fitlet/sw/gpio-fch-dkms_1.01.deb $ sudo dpkg -i gpio-fch-dkms_1.01.deb
# Download the GPIO dkms deb file from - [https://fit-iot.com/files/download/fitlet/sw/gpio-fch-dkms_1.01.deb HERE]# Run the shell and type the below commands: $ sudo -i $ dpkg -i gpio-fch-dkms_1.01.deb $ modprobe gpio_fch $ echo 89 > /sys/class/gpio/export $ echo out > /sys/class/gpio/gpio89/direction $ echo 1 > /sys/class/gpio/gpio89/value ## at this point voltage measuring on P-1 (Brown) should give 3.3V $ echo 0 > /sys/class/gpio/gpio89/value ## at this point voltage measuring on P-1 (Brown) should give 0.0V $ echo 89 > /sys/class/gpio/unexport == ''' GPIO connector Pinout''' ==
{| class="wikitable"
! Pin Number
|}
===Example for the GPIO input:=Usage example == $ sudo -i
$ modprobe gpio_fch
$ echo 89 > /sys/class/gpio/export
$ echo out > /sys/class/gpio/gpio89/direction
$ echo 1 > /sys/class/gpio/gpio89/value
## at this point voltage measuring on P-1 (Brown) should give 3.3V
$ echo 0 > /sys/class/gpio/gpio89/value
## at this point voltage measuring on P-1 (Brown) should give 0.0V
$ echo in > /sys/class/gpio/gpio89/direction
$ cat /sys/class/gpio/gpio89/value0value # # at this point cat command will print 0 or 1 depending if voltage measuring on P-1 (Brown) was 0V or 3.3V 
$ echo 89 > /sys/class/gpio/unexport
425
edits