Code to make my text flash

Hi, all.
I'd like to make ''KER'' and 'MAX'', flash alternately. Any help would be appreciated, here's my code.

#include <SPI.h>
#include <Wire.h>

#include <Adafruit_SSD1306.h>

#define OLED_RESET 4
Adafruit_SSD1306 Display(OLED_RESET);

int r = 0;
int i = 0;

void setup() {

Display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3C (for the 128x32)

// i'll follow the license agreement and display the Adafruit logo
// and since they were nice enough to supply the libraries
Display.clearDisplay();
Display.display();
delay (1000);

DrawTitles();

}

void loop() {

// get some dummy data to display

r = rand() / 220;
//r = analogRead(ADJ_PIN);
//r = r / 7.98;

Display.setTextSize(2);
// note set the background color or the old text will still display
Display.setTextColor(WHITE, BLACK);
Display.setCursor(0, 33);
Display.println(Format(r * 7.99 / 204.6, 3, 2));

//draw the bar graph
Display.fillRect(r, 50, 128 - r, 10, BLACK);
Display.fillRect(3, 50, r, 10, WHITE);

for (i = 1; i < 13; i++) {
Display.fillRect(i * 10, 50, 2, 10, BLACK);
}

// now that the display is build, display it...
Display.display();

}

void DrawTitles(void) {

Display.setTextSize(1);
Display.setTextColor(WHITE);
Display.setCursor(0, 0);
Display.println("ECTO SCANNER RUNNING");

Display.setTextSize(1);
Display.setTextColor(WHITE);
Display.setCursor(0, 14);
//Display.println("Measured Volts");
Display.println("KER");

Display.setCursor(0,24);
//Display.println("Measured Volts");
Display.println("MAX");
Display.display();

}

String Format(double val, int dec, int dig ) {

// this is my simple way of formatting a number
// data = Format(number, digits, decimals) when needed

int addpad = 0;
char sbuf[20];
String fdata = (dtostrf(val, dec, dig, sbuf));
int slen = fdata.length();
for ( addpad = 1; addpad <= dec + dig - slen; addpad++) {
fdata = " " + fdata;
}
return (fdata);

}

I'd like to make ''KER'' and 'MAX'', flash alternately

Where are you stuck ?

Use millis() for timing as explained in Using millis() for timing. A beginners guide, Several things at the same time and look at the BlinkWithoutDelay example in the IDE.

Print "KER", save the value of millis() and when the required period has elapsed print "MAX", save the time and keep going round loop() alternating the text when the display period expires.

Thanks!
It took a few times to absorb what you said but I think I have it. I'm trying to get my head around the millis link, I'm entirely new to this.
I can't just add millis(value) to the code, I have to input certain code so the arduino understands what millis is and what it does?
My head hurts, haha.

gbdan:
Thanks!
It took a few times to absorb what you said but I think I have it. I'm trying to get my head around the millis link, I'm entirely new to this.
I can't just add millis(value) to the code, I have to input certain code so the arduino understands what millis is and what it does?
My head hurts, haha.

Maybe this will help: millis() is a function . Nothing is placed between the parentheses since you don't pass values to it. It only returns a value to the (unsigned long) variable on the left side of the '=' sign. The value returned by millis() increments constantly in the background.

The elapsed time is determined by storing millis() once then, some time later subtracting the value you stored from the current value of millis(). Since the current value will be greater than the value stored, subtraction yields the number of milliseconds counted since the value was stored.

I can't just add millis(value) to the code, I have to input certain code so the arduino understands what millis is and what it does?

The BlinkWithoutDelay example does almost exactly what you want, but instead of changing the state of an output when the period ends print the appropriate text instead.