Skip to content
This repository was archived by the owner on Dec 20, 2018. It is now read-only.

Error in Intel Edison #2

Closed
sidneh opened this issue Sep 6, 2017 · 1 comment
Closed

Error in Intel Edison #2

sidneh opened this issue Sep 6, 2017 · 1 comment

Comments

@sidneh
Copy link

sidneh commented Sep 6, 2017

I am trying to run this code in Intel Edison with mraa library but it gives me error. Is not the library compatible with Intel Edison (Yocto Linux)?

  • Platform/operating system (i.e. Raspberry Pi with Raspbian operating system,
    Windows 32-bit, Windows 64-bit, Mac OSX 64-bit, etc.): Intel Edison Yocto 1.7.3

  • Python version (run python -version or python3 -version): Python 2.7

  • Error message you are receiving, including any Python exception traces:
    root@gozdewbl:~# python ads1115.py
    Traceback (most recent call last):
    File "ads1115.py", line 7, in
    adc = Adafruit_ADS1x15.ADS1115()
    File "/usr/lib/python2.7/site-packages/Adafruit_ADS1x15-1.0.2-py2.7.egg/Adafruit_ADS1x15/ADS1x15.py", line 319, in init
    super(ADS1115, self).init(*args, **kwargs)
    File "/usr/lib/python2.7/site-packages/Adafruit_ADS1x15-1.0.2-py2.7.egg/Adafruit_ADS1x15/ADS1x15.py", line 82, in init
    self._device = i2c.get_i2c_device(address, **kwargs)
    File "/usr/lib/python2.7/site-packages/Adafruit_GPIO/I2C.py", line 63, in get_i2c_device
    busnum = get_default_bus()
    File "/usr/lib/python2.7/site-packages/Adafruit_GPIO/I2C.py", line 55, in get_default_bus
    raise RuntimeError('Could not determine default I2C bus for platform.')
    RuntimeError: Could not determine default I2C bus for platform.

  • List the steps to reproduce the problem below (if possible attach code or commands
    to run):
    import Adafruit_ADS1x15
    import mraa
    import time
    import numpy

led = mraa.Gpio(20)
adc = Adafruit_ADS1x15.ADS1115()

GAIN = 1
value = led.read()
adc0 = adc.read_adc(0, gain=GAIN)
voltage = (adc0 * 0.1875)/1000

while True:
led.write(1)
print "led: ", value
print "voltage: ", voltage
time.sleep(0.50)
led.write(0)
print "led: ", value
print "voltage: ", voltage
time.sleep(0.5)

@caternuson
Copy link
Contributor

Hi! We are deprecating this library. This issue is either fixed or may need updating for the new library:
https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15

Please see issue summary here:
#13

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants