Jump to content

python gpio function not retuning proper values


iomari

Recommended Posts

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

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines