I dont necessarily want to limit the number of the pins used, I was just a little confused at first that the ones that were used for the CO2 sensor were also by default used by the display. However I have 3 arduino projects in mind, I might ordner and use the normal 16x2 one for this project, order the l2c ones for the next and use the already bought OLED for the third project. It might help me to figure out the functionality and programming for arduino better.
So I did some research and it maybe led me to a wrong path, I thought I have two possibilitys to assign pins: eighter I find out which pin has which number on my arduino board by using a link like this (in my case pins 1-30) or I use the name of the pin (like D1,D2...). Actually, neighter seems to be the case: seems like I cannot use D1,D2... to assign something, nor do the numbers 1-30.
However I found this default template for the display and it says
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
which is very confusing because in the description it says
- LCD D4 pin to digital pin 5
- LCD D5 pin to digital pin 4
- LCD D6 pin to digital pin 3
- LCD D7 pin to digital pin 2
so actually I guess if I define in a arduino code I just use the number of the digital pin written on the hardware minus the "D", so for pin D4 I would just use "4"..., for pin D5 I would use "5"...
Which would mean, if the display should not use pin D2-D4, I would change the code to:
const int rs = 12, en = 11, d4 = 10, d5 = 9, d6 = 8, d7 = 7;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
That would mean, I would connect the digital pins d4-d7 of the LCD to my arduinos digital pins D10-D7...
Wow, I am totally confused now, I might try to find a book that explains those kind of basics
Yes it is the entire code. Think I found and installed it in the normal library in the arduino code program, searching for MHZ19