Don, check out my recent blog post on ADC's here. http://www.embeddedhobbyist.com/2015/10/beaglebone-black-adc/
It covers setup for 4.x kernels, and sample code in C. If you need less than ~5800 samples a second for reads. This will work fine for you. If you need faster speeds, I'll be putting up a post on running continuous mode using the TI userspace driver. Sometime after that, mmap() + /dev/mem, and then using the PRU's to do the same task, but to offload the main processor. So also, if you want to output data to a web browser. You can use bare Nodejs. It would also probably be necessary to use /dev/shm ( POSIX shared memory ), and a C app to write the data out of the ADC into that file. Nodejs + fileWatcher() could be used to shuffle that data over a websocket. I've done something similar, but using all C + libmongoose. libmongoose to handle the web / websocket duties. All C has the advantage of being at least 4-5x faster. Which libmongoose is a C library for those duties, and more. On Mon, Oct 5, 2015 at 4:36 PM, 'Don Terry' via BeagleBoard < [email protected]> wrote: > Thanks for all your help. Based on your answers I added a try & catch on > the AnalogRead and that traps the error and keeps the code running so I can > retry the read. I am a C (with some C++) programmer so if I was doing this > in C I would find the A/D busy flag in a register somewhere and only read > when not busy. But I am trying to learn something new so I am learning > BoneScript - for better or worse. Pretty sure I will be programming in C > soon! > > -- > 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. > -- 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.
