NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/52219: Example included in gpio(3lua) incorrect



The following reply was made to PR bin/52219; it has been noted by GNATS.

From: Sevan Janiyan <venture37%geeklan.co.uk@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/52219: Example included in gpio(3lua) incorrect
Date: Mon, 8 May 2017 09:55:59 +0100

 On 08/05/2017 08:00, Marc Balmer wrote:
 >  > The reason is that gpio.read is expecting the configured gpio pin to read from whereas the example passes the value of number of configured pins on the system, minus one.
 >  
 >  No, it enumerates all pins and reads them.  Are you GPIO pins set to
 >  input, i.e. at they readable?  What happens when you try to read them
 >  out using gpioctl?
 >  
 
 My gpio.conf has
 gpio1 21 set out USR0
 gpio1 22 set out USR1
 gpio1 23 set out USR2
 gpio1 24 set out USR3
 
 the following works
 print('pin ' .. n .. ': ' .. gpiodev:read(21))
 
 the following (as per sample script) doesn't
 print('pin ' .. n .. ': ' .. gpiodev:read(n - 1))
 


Home | Main Index | Thread Index | Old Index