Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

python gpio function not retuning proper values

Featured Replies

Greetings,

On the tinkerBoard, I'm using python.

I having difficulty understanding why the functions don't return the values that is expected according tho the library help.

I'm using python3 and the ASUS GPIO library.

 

import ASUS.GPIO as GPIO 

GPIO.setmode(GPIO.BOARD)

 

This is the output from ipython:

In [18]: help(GPIO.gpio_function)                                                                                                                                                                                    
Help on built-in function gpio_function in module ASUS.GPIO:

gpio_function(...)
    Return the current GPIO function (IN, OUT, PWM, SERIAL, I2C, SPI)
    channel - either board pin number ,RK number or ASUS number depending on which mode is set.

 

But when I try for instance:

In [19]: GPIO.gpio_function(29)                                                                                                                                                                                      
Out[19]: 1

 

AS you can see, the return value is '1' not  (IN, OUT, PWM, SERIAL, I2C, SPI)

 

Also if I run:

 

In [20]: help(GPIO.getmode)                                                                                                                                                                                         
Help on built-in function getmode in module ASUS.GPIO:

getmode(...)
    Get numbering mode used for channel numbers.
    Returns BOARD, RK, ASUS or UNKNOWN

 

Then I run:

In [21]: GPIO.getmode()                                                                                                                                                                                              
Out[21]: 10
 

As you can see, I'm not getting a return of 'BOARD, RK, ASUS or UNKNOWN'

but instead I'm getting 10.

 

IS it me or are the outputs to these functions wrong?

 

iomari

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.