abelectronicsuk / abelectronics_python3_libraries Goto Github PK
View Code? Open in Web Editor NEWPython3 Libraries to work with Raspberry Pi expansion boards from AB Electronics
License: MIT License
Python3 Libraries to work with Raspberry Pi expansion boards from AB Electronics
License: MIT License
Hello,
Any plans to publish this as PyPI package? Or at least package it up for that so it can be installed using pip
from github directly:
$ pip install git+https://github.com/abelectronicsuk/ABElectronics_Python3_Libraries.git
Collecting git+https://github.com/abelectronicsuk/ABElectronics_Python3_Libraries.git
Cloning https://github.com/abelectronicsuk/ABElectronics_Python3_Libraries.git to /tmp/pip-4x8t8c8f-build
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/tadas/.virtualenvs/spaceship/lib/python3.4/tokenize.py", line 438, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-4x8t8c8f-build/setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-4x8t8c8f-build/
Many Thanks,
Tadas
Hi, I'm having trouble getting my Expander Pi board running. I'm trying to test the ADC but the code cannot find the necessary module.
This is the full error, from Python 3.4.2 Shell on Raspberry Pi Raspbian Jessie -:
Traceback (most recent call last):
File "/home/pi/Desktop/adctest.py", line 3, in <module>
from ABE_ExpanderPi import ADC
ImportError: No module named 'ABE_ExpanderPi'
>>>
I've followed the instructions on https://github.com/abelectronicsuk/ABElectronics_Python3_Libraries/tree/master/ExpanderPi and https://www.abelectronics.co.uk/kb/article/1/i2c--smbus-and-raspbian-wheezy
Running the command:
export
The output includes the line:
declare -x PYTHONPATH=":/home/pi/ABElectronics_Python3_Libraries/ExpanderPi/"
So the Python Path should be known.
Thanks for any help, cheers.
The difference in ABE_helpers.py between python3 and python is:
python3: raise ImportError("python-smbus not found'")
python2: raise ImportError("python-smbus not found. Install with 'sudo apt-get install python-smbus'")
suggest adding text: Install with 'sudo apt-get install python3-smbus'
Based upon the product webpage the maximum stated ADC clock speed under python is 12,000 samples per second. Even when changing the value of the spi clock in the ABE_ADCDACPi.py the speed seems to be fairly static at around 200 us. I'm using raspberry pi w with Jessie. Can anyone describe how to enable similar speeds for the ADC module?
Original:
spiADC.max_speed_hz = (900000)
Changed to:
spiADC.max_speed_hz = (25000000)
Code used for the test:
from ABE_ADCDACPi import ADCDACPi
import time
import numpy as N
import datetime
adcdac = ADCDACPi() # create an instance of ADCDACPi
adcdac.set_adc_refvoltage(3.3)
numPnts = 1000
a = N.zeros(numPnts)
counter = 1
starttime = datetime.datetime.now()
print(starttime)
while (counter < numPnts):
# read the voltage from channel 1
a[counter] = adcdac.read_adc_raw(1,0)
counter+=1
endtime = datetime.datetime.now()
print(endtime - starttime)
print(endtime)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.