Hopefully simple coding solution

I am a sys admin who inherited this project and could use a helping hand. This is a simple LCD running on a Teensy 2.0 board and has two push to talk buttons. I apologize for posting teensy in Arduinos hood but they are no help on that site.

I know nothing about programming but managed to pull the RGB colors off of the hardware and am now able to manipulate them in code.

The only thing I need to do now is make the lcd blink another color when the button is pushed. so right now say its blue they hit the button and I want it to turn green just for a second to acknowledge the button was pushed. and that's it lol

Any help or guidance is immensely appreciated and I will owe you beer if you help me.
here is my code!

#include <Bounce.h>
#include <LiquidCrystal.h>

Bounce ptt0 = Bounce(14, 10);
Bounce chanSelect0 = Bounce(13, 10);
LiquidCrystal lcd(12, 11, 23, 22, 8, 7);

int redpin = 4;
int greenpin = 9;
int bluepin = 10;

int pttPressed = 0;
int chanPressed = 0;
int chanNum = 1;

void setup() {
  pinMode (redpin, OUTPUT) ;
  pinMode (greenpin, OUTPUT) ;
  pinMode (bluepin, OUTPUT) ;
  
  pinMode(14, INPUT_PULLUP);
  pinMode(13, INPUT_PULLUP);
  lcd.begin(16, 2);
  lcd.print("Ch 1 - P!");
  lcd.setCursor(0, 1);
  lcd.print("----------------");
    digitalWrite (greenpin, HIGH) ;
}

void loop() {
  ptt0.update();
  chanSelect0.update();

  
 if (ptt0.fallingEdge() && chanPressed == 0) {
   pttPressed = 1;
 
  Keyboard.set_modifier(MODIFIERKEY_SHIFT);
  Keyboard.set_key1(KEY_P);

  //If the channel == 1 then send P!
  if (chanNum == 1) {
    Keyboard.set_key2(KEY_1);
  } 
  //If the channel == 2 then send P@
  if (chanNum == 2) {
    Keyboard.set_key2(KEY_2);
  } 
  //If the channel == 3 then send P#
  if (chanNum == 3) {
    Keyboard.set_key2(KEY_3);
  } 
  //If the channel == 1 then send P$
  if (chanNum == 4) {
    Keyboard.set_key2(KEY_4);
  } 
  //If the channel == 5 then send P%
  if (chanNum == 5) {
    Keyboard.set_key2(KEY_5);
  } 
  lcd.setCursor(0, 1);
  lcd.print("....Transmit....");

  Keyboard.send_now();
 }
 
 if (ptt0.risingEdge() && pttPressed == 1) {
   pttPressed = 0;
   Keyboard.set_modifier(0);
   Keyboard.set_key1(0);
   Keyboard.set_key2(0);
   lcd.setCursor(0, 1);
  lcd.print("----------------");
   Keyboard.send_now();
 }
 
 if (chanSelect0.fallingEdge() && pttPressed == 0) {
   chanPressed = 1;
 }
 
 if (chanSelect0.risingEdge() && pttPressed == 0) {
   if (chanNum == 5) {
     chanNum = 1;
     lcd.setCursor(0, 0);
     lcd.print("Ch 1 - P!");
   } else {
     chanNum = chanNum + 1;
     if (chanNum == 2) {
      lcd.setCursor(0, 0);
      lcd.print("Ch 2 - P@"); 
     }
     if (chanNum == 3) {
      lcd.setCursor(0, 0);
      lcd.print("Ch 3 - P#"); 
     }
     if (chanNum == 4) {
      lcd.setCursor(0, 0);
      lcd.print("Ch 4 - P$"); 
     }
   }
   chanPressed = 0;
 }
 }

Moderator edit: [code] ... [/code] tags added. (Nick Gammon)

managed to pull the RGB colors off of the hardware and am now able to manipulate them in code.

Where? I don't see anything being written to redpin, greenpin, or bluepin. You could write a value to one or more of those pins, and then call delay(). I wouldn't, though, I've read, understood, and embraced the blink without delay example, and you should, too.

Code tags, please.

Read this before posting a programming question

How to use this forum

I have the ability to pull the code into software. I haven't actually written anything in yet. Like I said I am not a programmer so I am still trying to figure out what I should do. Sorry about the code tags. won't happen again.

As far as the delay, where would it go in this code to make it work?

Do you want the display to flash (i.e. change colour) for however long the button is held down, or just for a brief fixed duration - in the latter case, should it flash when the key is pressed, or released?

I'm not following your references to colours. Is it a colour LCD? If so, do you know how to change the colour in the way you want for the 'flash'?

Either way would work really. either color change just for a moment or for the duration of the push. The alpha model was just a plain blue lcd which was simple because you just have to ground the correct pin to make it work. Then the next iteration was the model with RGB which means i had to instead of just grounding the pin bring the 3 color pins to the pwm on the teensy board. hopefully that makes sense.

I actually have some idea on how to make it blink. My main issue is where in the code structure to i put that instruction. after the void loop? at the very end?

I have a new found respect for coders after messing with this bad boy LOL

There are various statements in your code like this, which seem to be determining whether a button has been pressed:

if (ptt0.risingEdge() && pttPressed == 1) {
...
}

If you put code to make the display change colour, then a short delay, then make the display restore the original colour, it would produce a flash. This means that the Arduino would stop responding for the duration of the flash but that might be acceptable if you keep the duration short. If you take this approach I would suggest putting that code in a function and calling that in each place where you want a flash to occur.

The alternative approach would enable the Arduino to continue on while the flash happened - you would change the display colour, and save the current value of millis() in a global variable which holds the flash start time. Code at the start of loop() would reset the display colour when the flash duration has elapsed, similar to the way the blink without delay example sketch works.