Problem in code mixing an RPM counter + Large LCD display

Hello everyone! and thanks in advace for reading.

Mi problem is that i can't properly mix two diferents code samples and make a functional code of an RPM counter display, the first is the display of a large LCD charcter that I saw on YouTube here's the video of it:

But this (as amazing as it can look) just displays random numbers so I decided to give it a proper functionality.
Which code (after I modified it to work) is:

The second part of the code is the RPM counter that detects trough an optical encoder conected to digital pin 0 of the Arduino.
the code is this:

My LCD is 16x2 conected on Pins (12, 11, 5, 4, 3, 2), I must say that each part of the code works fine by its own but when i try to mix them (or at least get a real RPM display on the LCD) can't get them to work properly.

Don't be scared with the lenght of the code, most of the code is just for the design of the LCD characters the real code starts about the last 25% of the total lenght but I decided to put it complete in case anyone else decides to make it or something similar to this.

This is what i've been trying without success:

So I appreciate a lot any help you could give me.
Thanks a lot.

Large RPM caracters on 16x2 display.ino (4.2 KB)

rpm counter.ino (781 Bytes)

Large_RPM_caracters_PRUEBA.ino (5.54 KB)

When you were typing your post, perhaps you missed the Additional Options link, where you can post code that exceeds the 9500 character limit. I, for one, do not click on links to random external hosting sites.

My bad, sorry this is my first post here. Anyway the files are atached, thanks for the observation. Hope you could help me. Thanks!

What is different between custom0() and custom1()? Couldn't that be dealt with by passing an argument to custom()? Wouldn't that simplify (greatly) printNumber()?

You could put the custom character declarations in a header file, to shorten the sketch, too.

In printRPM(), rpm is passed by value. You can destroy that VALUE, with no affect on the value in the caller. There is no need to copy it to another variable.

Using Tools + Auto Format
would go a long
ways towards
making
your
code
readable.

  digitalRead(PMS_PIN);

Not much sense in calling digitalRead() if you are throwing the return value away.

printRPM(millis() % 10000);

Time hasn't got squat to do with RPM.

Thanks for the Reply, in the part:

digitalRead(PMS_PIN);

That value is which I'm trying to get it to appear on the display not like normal characters (that is already done) but instead with the custom characters. That value goes nowhere simply because I still have no idea how to make it appear on the LCD.

Any suggestion how can I accomplish this?

You are right, there's no point in using time in order to display the RPMs and already used the Auto Format tool.

Thanks for your time.

That value is which I'm trying to get it to appear on the display not like normal characters (that is already done) but instead with the custom characters.

"That value" will be 0 or 1. Specifically, what do you want to have happen when it is 0? When it is 1?

Sorry, just noticed I didn't deleted that part of the original code (of the RPM counter) that was for a blinking LED specifically Pin 13 LED on the board.

My big mistake, the correct question must have been: How do I print the value of "rpm" from the code of the original rpm counter

    lcd.clear();
    lcd.print("RPM: ");
    lcd.print(rpm*1);

in the form of special characters divided by 4 digits with its own cordenates of the "Large RPM characters" code

printNumber(m, 4);    
  printNumber(c, 7);    
  printNumber(d, 10);  
  printNumber(u, 13);

For instance I delete the part:

if (number > 999) {
    m = (number - (number % 1000)) / 1000;
    number = number % 1000;
  } 
  else {
    m = 0;
  }
  if (number > 99) {
    c = (number - (number % 100)) / 100;
    number = number % 100;
  } 
  else {
    c = 0;
  }

  if (number > 9) {
    d = (number - (number % 10)) / 10;
    number = number % 10;
  } 
  else {
    d = 0;
  }

Which Is the one that gives the random numbers, but just by that the Display only shows zeros "000" that same thing happened in the rpm counter code if not multiplied by "1" like this:

lcd.print(rpm*1);

Thanks and I'm sorry for being so ignorant in the matter, I'm still learning basics.