Your topic has been moved. Please do not post in "Uncategorized"; see the sticky topics in Uncategorized - Arduino Forum.
You will have to provide some more details. E.g. what all is connected and how. A wiring diagram could be useful.
If you don't have any other I2C devices, you will have two pins extra and you can possibly free the SPI bus.
If you have multiple SPI devices there is no problem because you can use the free pin that you have as a chip select.
Does the project use any other SPI devices? An SPI OLED could share MISO/MOSI/SCK with other SPI devices. Only one pin would need to be dedicated to the OLED (CS).
hi,
there is no wiring diagram available as such. project uses a custom pcb shield of some sort.
I am trying to figure it all out. it seems as though some of the digitally controlled outputs actually come from the analogue pins ( code configures up to pin 16, so guessing these are the pins labelled on the Uno board as A0-A5).
currently project has 4 x 18BS20 I2C sensors. this might increase. also analogue voltage & current sensors.
current screen is an I2C OLED 0.96". he wants a bigger screen but also likes the OLED type, which seem to mainly be SPI ( probably for good reason)
I am trying to keep text a reasonable physical size, so easy to read.
I did ponder using 2 displays, to separate the info displayed.
eg running info ( run time, Volts, amps) on 1 screen and 4 x temps on another.
Dual screen on I2C does not seem hugely difficult ( i hope). mainly seems to be physically addressable screens, via resistor on PCB and printscreen addressing in the code, if I understand it correctly
is dual screen on SPI much more complicated than dual I2C?
Would it require even more pins?
Yes, but it has several advantages. One is that it can be configured to use less RAM.
Uno has only 2KB RAM. If you exceed 80% usage, the
Uno becomes unstable.
With the Adafruit library, you are at 50% usage with one 128x64 display because it allocates 1024 bytes to hold the data. (It won't be reported like that by the IDE, but it is).
With the U8G2 library, it can use as little as 128 bytes, but the code may need to be restructured to allow this, because it updates the display in sections.
To be honest, I am not entirely sure how many of the pins on Uno are configurable.
i was surprised to learn that the A0 to A5 can also be digital.
(my code only lists up to pin 16)
but I am guessing that makes 20 configurable pins (D0 to D13) and A0 to A5).
is this correct?
if it is, I prob have enough spare pins for SPI
what I can confirm from code is this...
pin 0 - A2D conv
pin 1 not used
pins 2 through 13 digital I/O all used.
pins 14 & 15 not used (as far as i can tell)
pin 16 used for digital I/O, n.o. switch