Difference between revisions of "GPIO"

From Wiki for Dragino Project
Jump to: navigation, search
(Created page with "The Dragino MS12 has five GPIOs pins avaible on the 2x8 connctor for easy use. They are GPIO0~ GPIO4. these GPIOs connects to the Atheros ar2317 directly and can be control via o...")
 
 
Line 14: Line 14:
 
examples:
 
examples:
  
set GPIO4 to output HIGH (3.3v)
+
Simply connet the GPIO4 and LED pin via a wired. LED1 will be on if there is a LOW singal. you can type:
 
  root@dragino:~# gpioctl dirout 4
 
  root@dragino:~# gpioctl dirout 4
  using gpio pin 4
+
  using gpio pin 4     ==> this will set the GPIO4 to output and default is LOW. this will turn on LED1
 
  root@dragino:~# gpioctl set 4
 
  root@dragino:~# gpioctl set 4
  using gpio pin 4
+
  using gpio pin 4     ==> set GPIO4 to HIGH and turn off LED1.

Latest revision as of 08:33, 29 April 2011

The Dragino MS12 has five GPIOs pins avaible on the 2x8 connctor for easy use. They are GPIO0~ GPIO4. these GPIOs connects to the Atheros ar2317 directly and can be control via openwrt command gpioctl command.

The input and ouput voltage of these GPIO is 3.3v.

gpio command:

root@dragino:~# gpioctl
gpioctl dirin|dirout|get|set|clear gpio
dirin: configure GPIO pin as input
dirout: configure the GPIO pin as output
get: get the GPIO status: HIGH or LOW
set: set the GPIO to HIGH
clear: set the GPIO to LOW

examples:

Simply connet the GPIO4 and LED pin via a wired. LED1 will be on if there is a LOW singal. you can type:

root@dragino:~# gpioctl dirout 4
using gpio pin 4     ==> this will set the GPIO4 to output and default is LOW. this will turn on LED1
root@dragino:~# gpioctl set 4
using gpio pin 4     ==> set GPIO4 to HIGH and turn off LED1.