hybridgroup / artoo

Ruby framework for robotics, drones, and the Internet of Things (IoT)
http://artoo.io
Other
1.54k stars 143 forks source link

Question: Raspberry Pi and Sensors #164

Open epipheus opened 8 years ago

epipheus commented 8 years ago

So the GPIO documentation for the Raspberry Pi does not include sensors? Why not? Does the sensor interface not work for RPi?

deadprogram commented 8 years ago

Hi @epipheus the Raspberry Pi does not support analog I/O (AIO), due to not having the required hardware interface.

Hope that helps!

epipheus commented 8 years ago

Wait I don't get why the dsl you've built can't include sensors through the GPIO+ADC

Sent from my iPhone

On Oct 4, 2016, at 12:35 PM, Ron Evans notifications@github.com wrote:

Hi @epipheus the Raspberry Pi does not support analog I/O (AIO), due to not having the required hardware interface.

Hope that helps!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

deadprogram commented 8 years ago

Sorry, perhaps I was unclear. The Raspi has digital I/O but not analog I/O, due to not having an onboard ADC.

epipheus commented 8 years ago

So does the sensor dsl work with RPi if you add an ADC?

Sent from my iPhone

On Oct 5, 2016, at 3:57 AM, Ron Evans notifications@github.com wrote:

Sorry, perhaps I was unclear. The Raspi has digital I/O but not analog I/O, due to not having an onboard ADC.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

epipheus commented 8 years ago

Dude, I just want to know if artoo is useful for the case where one wants to use RPi and analog sensors through a 3rd party ADC -- will your below DSL work in this case:

  device :sensor, driver: :analog_sensor, pin: 0, interval: 0.25, upper: 900, lower: 200
epipheus commented 8 years ago

I appreciate that you are responding. But I first asked about this in Jun.

deadprogram commented 8 years ago

You would need to create a driver for that ADC that consumes the i2c interface for the Raspi, and to provide the AIO interface functions for other devices. Did you have a specific ADC in mind?

epipheus commented 8 years ago

Anything easily purchased :)

Sent from my iPhone

On Oct 6, 2016, at 12:50 AM, Ron Evans notifications@github.com wrote:

You would need to create a driver for that ADC that consumes the i2c interface for the Raspi, and to provide the AIO interface functions for other devices. Did you have a specific ADC in mind?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

epipheus commented 8 years ago

Also and again, I'm trying to evaluate using artoo so I don't know. Does the sensor Dsl work at all for digital sensors or does it not because each digital sensor simply has its own ADC on board which would need a driver as you described? On Thu, Oct 6, 2016 at 7:59 AM Michael Madison mkm@cocoonventures.com wrote:

Anything easily purchased :)

Sent from my iPhone

On Oct 6, 2016, at 12:50 AM, Ron Evans notifications@github.com wrote:

You would need to create a driver for that ADC that consumes the i2c interface for the Raspi, and to provide the AIO interface functions for other devices. Did you have a specific ADC in mind?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hybridgroup/artoo/issues/164#issuecomment-251872931, or mute the thread https://github.com/notifications/unsubscribe-auth/AAVT3wufrKFdQD8bvs9ju7cZkqGil_t-ks5qxIwQgaJpZM4I-QwK .

deadprogram commented 8 years ago

Not sure if you've seen these docs yet: http://artoo.io/documentation/guides/what_is_artoo/ and http://artoo.io/documentation/guides/concepts/ should be helpful.

Basically, in Artoo terms, the raspi is an adaptor that provides the interface to the raspi's GPIO & I2C, but not AIO due to not having any built-in ADC. Artoo's Drivers consume the various interfaces provided by Adaptors, such as GPIO, AIO, or I2C.

What I am working on in Gobot actually, is the idea of a Driver that consumes the I2C interface of the Adaptor for the system it is running on like the Raspi, and then itself provides the AIO interface to other Drivers, so you can easily use an ADC daughterboard such as the RaspIO AnalogZero http://rasp.io/analogzero/

Once I have it working in Gobot, I intend to cross-port it to Artoo.

Anyhow, hopefully this explanation was useful. Thanks for asking good questions.