SPI vs I2C on Breakout Garden

I have my new Breakout Garden mini to make a weather station. I have the BME680 and the 1.12" OLED SPI.

I verified that the BME680 and LCD work individually.

The example in the BG lib (weather.py) only references the I2C version.

Set up OLED
oled = sh1106(i2c(port=1, address=0x3C), rotate=2, height=128, width=128)

How can I switch this to SPI? TIA.

You’ll likely have to roll the weather.py code, or part of it, from here,

Into the breakout garden file, removing the OLED i2c stuff.
I’d open the two files up in two separate instances of idle, or what ever IDE you like and compare them. Then trade code from one to the other.

Thanks. I was hoping I could just substitute a line but I think you’re right that I’ll have to cut and paste code. I know the display works. I’ll have to dig into the examples for displaying text. At least I have a new project.

I was hoping / thinking it would be that simple also, until I looked at the code. =(
I’ve done lots of i2c stuff, but next to no SPI coding. I’m not sure I even have any SPI doflickys.

I bought it instead of the I2C because it was supposed to be faster but maybe it wasn’t worth it for a weather center. Should be fun figuring it out.

The one I’m interested in is this one, it’s also SPI.

All the breakout garden stuff I have so far is i2c. It just worked out that way. I’ve only bought a few sensors so far.

I2C is definitely easier to interface. SPI can’t be that bad. :)

As my tech buddy would say,
It’s the same thing but different, lol.

It looks like it may be as simple as specifying the interface at program startup.

And for the SPI I need to specify the slot on the Garden. Even with the BG Mini.

Somebody was bored, lol. :P =)
Ah, Ok, I hadn’t even looked at the code for the breakout garden itself.
All my breakouts are plugged into one big solderless breadboard.
You appear to be well on your way to getting it working, have fun.

I’m retired so that’s an occupational hazard. :)

I don’t think there is any specific code for the BG except for designating the SPI slot. The I2C boards take care of themselves. The single SPI slot on the BG Mini is slot 1 instead of slot 0, which threw me off.

I’m also retired, I know what you mean. I usually have all kinds of free time to play with.
Too many other distractions this time of year though, so just finding time to get on the forum has been tough.
Anyway, hopefully its smooth sailing getting your weather setup going. I’ll be upgrading mine when I find time. I may just wait till the weekend to start.

Thanks. I hope that most of the code from my Enviro setup can be adapted.