Curt Carpenter <[email protected]> wrote: > [-- text/plain, encoding 7bit, charset: UTF-8, 97 lines --] > > I'm still mystified by the documentation, and come to the BBB from OS-free > environments where everything is done at the register level, and almost > everything one needs to know is in the data sheet/TRM. I'd like to impose > on you with one more question if I can > (this is not a rant! Trying to get organized). > I agree with you (previous questions as well) the documentation of the BBB I/O is lacking in many ways, it's *very* difficult to get into it.
Seeing how some of the code works (e.g. Adafruit I/O libraries) I think the people who wrote that code had the same problem! :-) > I found (stumbled on) an article on reading the analog inputs on the web > that works: > > echo BB-ADC > /sys/devices/bone_capemgr.*/slots > cd /sys/bus/iio/devices/iio:device0 > cat in_voltage0_raw > ... and that's the *real* raw value, not the pseudo-raw value that the Adafruit libraries give you. > Am I correct in understanding that there is no documentation that would > have pointed me to the /sys/bus/iio/devices/iio:device0 > directory and given me some guidance on what it contained? > Apart from the zillion page processor documentation I think you're right. > I have the feeling that the docs ARE there, I just haven't located the > mother ship yet :-) > The 'mother ship' is google searching as far as I can tell, there is no decent, high level overview that a reasonably proficient software person can pick up and use. > I haven't tried python or bonescript: sticking with C/C++ until I learn my > way around the BBB first before I tackle the added complication of a new > language. If I were to shift to python though, is there any particular doc > I would read to learn how to do something like use the device tree and the > A/Ds? If so, I might abandon C just in the interest of working on a > stable, documented software platform. > I think you're making life harder for yourself using C/C++. I'm a C/C++ programmer (30 or more years, now retired) but use Python on the BBB and many other places. Python is a nice, regular, intelligible language. Unless you need the absolute ultimate in speed it will do all you want on the BBB. As someone else pointed out, to read the ADC using Python you just do:- > > import Adafruit_BBIO.ADC as ADC > > ADC.setup() > > ADC.read(self.pin) > > You have to install the Adafruit BBIO library first of course. The documentation of the Adafruit libraries isn't all *that* comprehensive but they're pretty simple so no problem really. As I pointed out above though the code is a little odd in places, for example the 'raw' value returned by the Adafruit library is simple the processed value (which is in millivolts) divided by 1800 which isn't my idea of a raw value! -- Chris Green ยท -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
