-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem running PyBBIO ADC code on BBB attached to 4D Systems 4DCAPE #98
Comments
I haven't used the 4D systems cape, but it looks like it's got a resistive touch screen and is using the ADC inputs AIN1, AIN2, AIN3 and AIN4 for that. In theory it would be possible to get AIN5 and AIN6 working for general use, but that would require some Device Tree hacking, and maybe editing the DT overlay used by that cape. If you need the cape and some ADC inputs, it would probably be a lot easier to just use an external ADC. e.g. PyBBIO already has a library for the ADS786x series SPI ADCs. |
Thanks Alex. Late last night after updating the Debian OS to from 3.8.13 Sent from my iPhone On Mar 16, 2016, at 8:28 AM, Alex Hiam [email protected] wrote: I haven't used the 4D systems cape, but it looks like it's got a resistive In theory it would be possible to get AIN5 and AIN6 working for general — |
Well that sounds like progress. Unfortunately I doubt you'll get much support from 4D, considering the datasheet is wa outdated with only Angstrom instructions, and has this notice:
😒 You might be able to get some help on the #beagle irc channel (Robert is rcn-ee in there). |
Yes, I'm pretty sure you're right about 4D and I do think Robert is a On 3/16/2016 9:39 AM, Alex Hiam wrote:
|
Hi Alex: On 3/16/2016 9:39 AM, Alex Hiam wrote:
|
Weird, so the ADC is working along side the LCD and touchscreen? It could be that the overlay the 4D cape is using changed after bone50. Since that overlay was made for different hardware and 4D offers zero software support, I wouldn't be surprised if it's just totally broken in more recent kernel versions 😒 |
Hi Alex, Sent from my iPhone
|
Alex: On 3/16/2016 9:39 AM, Alex Hiam wrote:
|
Alex:
I just now installed your PyBBIO and am having a problem with analogRead. My BBB is attached to a 4D_Systems 4DCAPE, and apparently that's causing the problem. Have a similar problem with Adafruit ADC code. Is the problem fixable? (BTW, PyBBIO PWM output works fine.)
http://www.4dsystems.com.au/product/4DCAPE_70T/
Traceback (most recent call last):
File "/var/lib/cloud9/ADC_Test.py", line 23, in
run(setup, loop)
File "/usr/local/lib/python2.7/dist-packages/bbio/bbio.py", line 60, in run
loop()
File "/var/lib/cloud9/ADC_Test.py", line 13, in loop
val1 = analogRead(pot1)
File "/usr/local/lib/python2.7/dist-packages/bbio/platform/beaglebone/adc.py", line 30, in analogRead
cape_manager.load(ADC_ENABLE_DTS_OVERLAY, auto_unload=False)
File "/usr/local/lib/python2.7/dist-packages/bbio/platform/beaglebone/cape_manager.py", line 27, in load
f.write(overlay)
IOError: [Errno 17] File exists
Here's my program:
Import PyBBIO library:
from bbio import *
pot1 = AIN4 # pin 33 on header P9
pot2 = AIN5 # pin 36 on header P9
def setup():
Nothing to do here
pass
def loop():
Get the ADC values:
val1 = analogRead(pot1)
val2 = analogRead(pot2)
And convert to voltages:
voltage1 = inVolts(val1)
voltage2 = inVolts(val2)
print " pot1 ADC value: %i - voltage: %fv" % (val1, voltage1)
print " pot2 ADC value: %i - voltage: %fv\n" % (val2, voltage2)
delay(500)
Start the loop:
run(setup, loop)
Thanks for your help.
John
The text was updated successfully, but these errors were encountered: