I2C and SPI on the Pi


#1

I’ve successfully configured a Pi 3 B+ and can play with it using Tinker. Now I’d like to access the I2C bus but can’t seem to get anywhere using Particle’s Web IDE (<Wire.h> is not found). There are other I2C libraries that I can grab, but that last little detail of being able to actually find the hardware is still evasive. Thoughts? Thanks!


#2

If Wire is supported with Particel Agent then you won’t need to include anything else than Particle.h


#3

~I2C master mode, not using DMA, should work on the Pi. I think SPI as well but I never tested it.~

Like ScruffR said, no need to include Wire.h, it’s available if you use a .ino file or

#include "Particle.h"

This includes some other things you might need to do to get I2C to work.

https://docs.particle.io/faq/particle-devices/i2c-faq/electron/#raspberry-pi-master-photon-i2c-slave

Oh, wait, I just re-read what I wrote in that link. I never got I2C to work using Particle Pi. That’s using native Pi I2C. I’m not sure I2C and SPI work on Particle Pi, but they might in non-DMA mode.


#4

I haven’t installed Particle Agent - I thought it was just a monitoring/diagnostic thing. Looks I may need that after all, eh?


#5

…and ignore my last. Of course I have the Agent installed. My brain is elsewhere! Header file included and I am further than I was a few moments ago. Thank you!