Beginner (still) wanting help with personal project!

Hello. Anyways, I had the idea to make a neat thing that could show different things such as temperature, humidity, light level, and more on an lcd display, but the obvious limitation of a 16x2 lcd is size. I had the idea to have "pages" or "modes" to switch through at the push of a button so I could use every mode. I know with 5 different "pages" it's a lot of data, and I do have an SD card w/ the proper board. Since I still after years know virtually nothing, how could I program the pages to turn from a button? Everything else for the data on each one I can do, and thank you so much in advance!

Not sure why you need an SD card?

Just detect button presses, and each time you get one display the next screen... something like below. Instead of writing to the serial monitor you will write whatever to your LCD.

int buttonValue;
int previous = HIGH;
int pin = 2;
int screenNumber = 0;

void setup()
{
  Serial.begin(115200);
  pinMode(pin, INPUT_PULLUP);
}

void loop()
{
  buttonValue = digitalRead(pin);

  if (buttonValue == LOW && previous == HIGH)  // Has a button just been pressed?
  {
    switch (screenNumber)                      // Select the screen to display.
    {
      case 0:
        Serial.println ("Display temperature page");
        break;
      case 1:
        Serial.println ("Display humidity page");
        break;
      case 2:
        Serial.println ("Display light page");
        break;
    }
    
    screenNumber = (screenNumber + 1 ) % 3;    // Calculate the next screen number 
  }

  previous = buttonValue;
}
1 Like

Thank you so much! And the SD card is just because i'll have to load multiple constant readings, remote controls, and the other things I plan on having in it. Anyways, thank you again! It worked perfectly!

No need to limit yourself to a 16x2. There are several el cheapo multiple-line displays available.


The above is a 5110 - a bit dated these days, but it has six easily-readable lines.

1 Like

Thank you! True, but I wanted to make it all as a day project, and I probably will order much bigger displays like the one you showed. Thank you for helping!

1 Like

Note that that is not a big display. The screen area is about 25x35.

1 Like

yeah lol its still a lot bigger than mine (mine still has a big personality though)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.