I believe it installed properly. Just in case, my method was to copy the Github folder into /home/pi and used the command 'sudo python3 setup.py install' and it seems to have installed.
My code however is not functioning properly. When I use the command 'i2cdetect 0' I get the error 'Could not open file '/dev/i2c-0' or '/dev/i2c/0.'' Using 'i2cdetect 1' works and I am able to see my device on the bus. When I try to run my code I get a similar error telling me that there is no such file or directory '/dev/i2c-0.'
Here are snippets of my code:
Code: Select all
import smbus
import csv
import time
from datetime import datetime
import subprocess, sys
import quick2wire.i2c as i2c
import logging
sens_addr = 0x28
bus = smbus.SMBus(1)
with i2c.I2CMaster() as bus: #this is where the error happens
read_results = bus.transaction(
i2c.reading(sens_addr, 4))
block = read_results[0,1,2,3][0] #haven't gotten far enough to see if this works