Vantron
| Embedded in your success, Embedded in your better life
World-leading provider of embedded/IoT products and solutions
C335 Series Edge Computing Gateways | User Manual
22
3.
Transmit data from Gateway A;
~# ifconfig can0 up
~# cansend can0 5A1#11.2233.44556677.88
4.
The data will be printed on Gateway B.
1.7.3
GPIO (C335)
The pins on the GPIO header are described below.
Name
Pin #
"gpio_in1" (gpio0_22)
22
"gpio_in2" (gpio0_23)
23
"gpio_out1" (gpio0_26)
26
"gpio_out2" (gpio0_27)
27
1.
Write a GPIO pin number to “/sys/class/gpio/export” to export the pin, for instance
pin 22:
~# echo 22 > /sys/class/gpio/export
2.
Set the pin direction as input or output (in for input and out for output);
~# echo out > /sys/class/gpio/gpio22/direction
3.
If you configured an output pin in the prior step, now you can set its value to 0 or 1
(corresponding to low or high) as follows:
~# echo 0 > /sys/class/gpio/gpio22/value [set it low], or
~# echo 1 > /sys/class/gpio/gpio22/value [set it high]
4.
Read the GPIO value;
~# cat /sys/class/gpio/gpio22/value
5.
When you finish using the pin, just unexport it. To do this, write the pin number to the
unexport file:
~# echo 22 > /sys/class/gpio/unexport