제품 정보 게시판


서버/워크스테이션 제품군과 관련하여
다양한 제품정보를 제공하고 있습니다.

서버비즈-ASUS-산업용메인보드-상품안내-배너
제목[AIOT] ASUS Tinker Board 2 / 2S 레이아웃 및 GPIO Pin OUT2022-04-14 12:27
작성자 Level 10

[AIOT] ASUS Tinker Board 2 / 2S 레이아웃 및 GPIO Pin OUT 


Tinker Board 2 / Tinker Board 2S 싱글보드 컴퓨터 레이아웃
(상단 제품명 클릭시 제품 판매페이지로 연결됩니다.)  

<전면부>
<후면부>
*eMMC 16GB 메모리는 Tinker Board 2S 제품에 장착되어 있습니다.


Tinker Board 2 / Tinker Board 2S 40P GPIO 헤더
Tinker Board 2 / Tinker Board 2S 40P GPIO Pin Out List

GPIO Config Table for Tinker Board 2 series:


Tinker Board 2 series:

C:

C is a general-purpose, imperative computer programming language, supporting structured programming, lexical variable scope and recursion, while a static type system prevents many unintended operations.

Ps: The GPIO WiringPi for C library has been installed in Tinker Board 2 series by default. Step 1 and 2 can be ignored.

  1. Navigate to folder

cd /usr/local/share/gpio_lib_c_rk3399

  1. Install C GPIO library for Tinker Board 2 series

sudo ./build

  1. Check install success or not

gpio readall

Tinker 2S_GPIO

  1. Reference codes

There’re few sample codes under this folder

/usr/local/share/gpio_lib_c_rk3399/examples

To make a simple script create a file with ‘nano blink.c’ and input the following code.

Sample LED blink: Please reference the pin map results about gpio readall.

  • GPIO
#include <stdio.h>
#include <wiringPi.h>

// LED Pin - wiringPi pin 30 is GPIO2A7 71.
#define LED     30

int main (void)
{
  printf ("Tinker board 2 blink\n") ;
  wiringPiSetup () ;
  pinMode (LED, OUTPUT) ;

for (;;)
  {
    digitalWrite (LED, HIGH) ;  // On
    delay (500) ;               // mS
    digitalWrite (LED, LOW) ;   // Off
    delay (500) ;
  }

  return 0 ;
}

To run the script run the command:

sudo gcc -o blink blink.c -lwiringPi

To run the newly compiled led run the command ‘sudo ./blink

.sh file for Tinker_2S_Test_input_gpio: https://github.com/TinkerBoard/TinkerBoard/files/8109019/Tinker_2S_Test_input_gpio.zip

Python:

Python is a programming language that lets you work quickly and integrate systems more effectively.

Ps: The GPIO WiringPi for Python library has been installed in Tinker Board 2 series by default. Step 1 and 2 can be ignored.

  1. Please refer to the pin mapping table above

  2. Navigate to folder

cd /usr/local/share/gpio_lib_python_rk3399

  1. Install Python GPIO library for Tinker Board 2 series for python and python3

sudo python setup.py install

sudo python3 setup.py install
  1. Reference codes

There’re few sample codes under this folder

cd /usr/local/share/gpio_lib_python_rk3399/test

To check the sample code by ‘nano forloop.py’ and you can see the following codes.

Sample forloop functions: set the all gpio value to high and then set all gpio value to low

import ASUS.GPIO as GPIO
import unittest
import time
# to use ASUS tinker board pin numbers
GPIO.setmode(GPIO.BOARD)

# set up GPIO output channel, we set GPIO4 (Pin 7) to OUTPUT

n = 40

for counter in range (1, n+1):
        if counter == 1 or \
           counter == 2 or \
           counter == 4 or \
           counter == 6 or \
           counter == 9 or \
           counter == 14 or \
           counter == 17 or \
           counter == 20 or \
           counter == 25 or \
           counter == 30 or \
           counter == 34 or \
           counter == 39 :
                continue

        GPIO.setup(counter, GPIO.OUT)
        GPIO.output(counter,GPIO.HIGH)
        time.sleep(1)

for counter in range (1, n+1):
        if counter == 1 or \
           counter == 2 or \
           counter == 4 or \
           counter == 6 or \
           counter == 9 or \
           counter == 14 or \
           counter == 17 or \
           counter == 20 or \
           counter == 25 or \
           counter == 30 or \
           counter == 34 or \
           counter == 39 :
                continue

        GPIO.output(counter,GPIO.LOW)
        time.sleep(1)

To run the python sample code by the following commands:

sudo python forloop.py

Ps: Please reference the pin value by ‘gpio readall’.

 
보다 자세한 상담을 원하실 경우 서버비즈특판팀으로 전화 및 메일 문의 부탁드립니다.
대표전화 : 02) 707-0120 내선 : 8891 (토/일요일 및 공휴일 휴무) | 전자우편 : yj_seo@stcom.co.kr
#Tinker board 2# Tinker board 2s# tinker# asus#아수스# 팅커보드#tinker board 2 gpio#gpio#tinker board 2s gpio