You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by "David G. Simmons" <sa...@mac.com> on 2017/01/17 16:32:42 UTC

SPI/I2C on Arduino Primo

Devs,

Has anyone used the SPI or I2C on Arduino Primo? Anyone have any sample code? Kevin Townsend wrote the Adafruit_BME280_Library in C++ and this is the part I'm working with right now, so I do have a starting point from that end, but from the MyNewt end?

TIA,
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.



Re: SPI/I2C on Arduino Primo

Posted by "David G. Simmons" <sa...@mac.com>.
I'm thinking it should be possible to just pull in your existing Adafruit_BME280_Library maybe? Or maybe not since it's C++ ... Let's say that is possible, How would I go about that?

The I2C transactions should, as you say, be pretty straightforward with what you already provided.

dg

> On Jan 17, 2017, at 11:35 AM, Kevin Townsend <ke...@adafruit.com> wrote:
> 
> You can look at the LSM303DLHC driver I implemented here as a starting point for I2C ... that should cover the basics like the I2C transactions, which is 1/2 the work already: https://github.com/apache/incubator-mynewt-core/tree/sensors_branch/hw/drivers/sensors/lsm303dlhc
> 
> You have to look in 'sensors_branch' though.
> 
> K.
> 
> 
> On 17/01/17 17:32, David G. Simmons wrote:
>> 
>> Devs,
>> 
>> Has anyone used the SPI or I2C on Arduino Primo? Anyone have any sample code? Kevin Townsend wrote the Adafruit_BME280_Library in C++ and this is the part I'm working with right now, so I do have a starting point from that end, but from the MyNewt end?
>> 
>> TIA,
>> 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/ 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.
>> 
>> 
> 

--
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.



Re: SPI/I2C on Arduino Primo

Posted by Kevin Townsend <ke...@adafruit.com>.
You can look at the LSM303DLHC driver I implemented here as a starting 
point for I2C ... that should cover the basics like the I2C 
transactions, which is 1/2 the work already: 
https://github.com/apache/incubator-mynewt-core/tree/sensors_branch/hw/drivers/sensors/lsm303dlhc

You have to look in 'sensors_branch' though.

K.


On 17/01/17 17:32, David G. Simmons wrote:
>
> Devs,
>
> Has anyone used the SPI or I2C on Arduino Primo? Anyone have any 
> sample code? Kevin Townsend wrote the Adafruit_BME280_Library in C++ 
> and this is the part I'm working with right now, so I do have a 
> starting point from that end, but from the MyNewt end?
>
> TIA,
> dg
> --
> David G. Simmons
> (919) 534-5099
> Web <https://davidgs.com> \u2022 Blog <https://davidgs.com/davidgs_blog> \u2022 
> Linkedin <http://linkedin.com/in/davidgsimmons> \u2022 Twitter 
> <http://twitter.com/TechEvangelist1> \u2022 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/ Secure your email!!!
>  * Public key available at keyserver.pgp.com <http://keyserver.pgp.com/>
> **/
> \u267a 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.
>
>