02-18-2017, 12:16 PM
|
RPi.GPIO python module for Pine A64/A64+
|
|
02-19-2017, 10:30 AM
no one has mentioned the script,
create_gpio_user_permissions.py is there some criteria by which this script should [or should not] be run? it seems like maybe it should be run but maybe it is called from another install script? thanks.
02-19-2017, 12:18 PM
02-20-2017, 08:30 AM
After getting the git, yes, only "python setup.py install" is required.
02-21-2017, 04:43 AM
Which system image did you use?
02-22-2017, 04:16 AM
(02-21-2017, 04:43 AM)JasperBrown Wrote: Which system image did you use? If you meet us on irc chat we can help you in real time; often its faster with less confusion. see below for chat room details
marcushh777
please join us for a chat @ irc.pine64.xyz:6667 or ssl irc.pine64.xyz:6697 ( I regret that I am not able to respond to personal messages; let's meet on irc! )
02-23-2017, 10:05 AM
09-01-2017, 07:23 PM
Has anybody used this library for I2C?
I got my first I2C device recently, this temp/pressure sensor. I tried reading it from an ESP8266 and an arduino first and didn't have any luck, so I decided to give it a try on the pine64. It shows up on i2cdetect, and if I run "sudo i2cdump twi1 0x76" it dumps a bunch of data, so I'm guessing it's wired up right. I saw in the notes in github that this library has I2C "borrowed from pyA20", so a little googling found me some documentation here (you have to scroll a bit to get to the I2C info). From that info, I put together this python script: Code: #!/usr/bin/env python3
from RPi import I2C
I2C.init("/dev/twi1")
I2C.open(0x76)
# set power mode to forced
I2C.write([0xF4,0x01])
sleep(1)
# dump data
I2C.write([0xF7])
value = I2C.read(1)
print(value)
I2C.close()
quit()Now when I run this (as root) using python3, I get this error: Code: Traceback (most recent call last):
File "./bmp280_readonce.py", line 2, in <module>
from RPi import I2C
File "/usr/lib64/python3.4/site-packages/RPi/I2C/__init__.py", line 4, in <module>
from RPi._I2C import *
ImportError: dynamic module does not define init function (PyInit__I2C)I tried changing the first line to use python2 instead of python3, and then I get this error instead: Code: Traceback (most recent call last):
File "./bmp280_readonce.py", line 5, in <module>
I2C.open(0x76)
IOError: [Errno 2] No such file or directoryAny idea what I'm doing wrong?
09-03-2017, 11:59 AM
Are you using the library from https://github.com/swkim01/RPi.GPIO-PineA64 ?
I've verified it with both python2.7 and python 3.5 under Armbian, and it is working with both.
09-03-2017, 12:49 PM
Yes, that's the one. So far I've just used it to blink LED's. This is my first attempt at trying to work with I2C. I wonder if there's some sample code that I could look at somewhere.
|
Users browsing this thread: 2 Guest(s)

