Moving on from the BLE -- which now works perfectly -- and I understand how 
'subscribed' values work in nimBLE, thanks to all who responded! 

Next up is implementing an ADC-based sensor. All the NRF52DK stuff has been 
moved out of -core and into mynewt-nordic, and I've looked through the source 
there as well. 

From my understanding of the board, the ADC pin is P0.03, and I've tested the 
sensor, and it works. So, only questions are:

Given the move to external packages, how does the #include work? I've tried 
about every iteration of #include "drivers/adc/adc_nrf52/adc_nrf52.h" I can 
think of. :-) 

Using the ADC: 

struct os_dev adc_dev;
rc = nrf52_adc_dev_init(&adc_dev, void *);
assert(rc == 0);

Should then initialize the ADC? Or do I need to nrf52_adc_open() first? 

And subsequently, how to read the ADC. Do I nrf52_adc_read_channel(), 
nrf52_adc_read_buffer() or ?? 

This is the first ADC Tutorial for the Mynewt docs, so I'd like to get it 
exactly right. :-) 

Oh, the sensor is this one: https://www.adafruit.com/products/1786 which is a 
pretty cool liquid level sensor. 

dg
--
David G. Simmons
(919) 534-5099
Web <https://davidgs.com/> • Blog <https://davidgs.com/davidgs_blog> • Linkedin 
<http://linkedin.com/in/davidgsimmons> • Twitter 
<http://twitter.com/TechEvangelist1> • GitHub <http://github.com/davidgs>
/** Message digitally signed for security and authenticity.  
* If you cannot read the PGP.sig attachment, please go to 
 * http://www.gnupg.com/ <http://www.gnupg.com/> Secure your email!!!
 * Public key available at keyserver.pgp.com <http://keyserver.pgp.com/>
**/
♺ This email uses 100% recycled electrons. Don't blow it by printing!

There are only 2 hard things in computer science: Cache invalidation, naming 
things, and off-by-one errors.


Reply via email to