How to make Built-In LED blink systematically?

I am trying to make my built in LED on my arduino blink every 1 second while recording my data and putting it in the EEPROM, but I am not sure how to do that. I am supposed to print data to the EEPROM every minute, until the EEPROM is full and while that is going on my built in LED should blink for approx 1 second. My problem seems to be that I am setting a delay to delay how long the data is stored on the EEPROM, but it is also affecting the time it takes for my LED to blink as it is waiting to blink as the data is stored. Any help would be appreciated, the code is below:

const int SWITCH = 4;

void setup() {
// put your setup code here, to run once:


void loop() {
// put your main code here, to run repeatedly:
int addr = 0;
float v;
float c;
int t = 0;
int r = analogRead(0);

if (digitalRead(SWITCH) == LOW) {
while (addr <= 1024) {
EEPROM.put(addr, r);
addr = addr + 2;
while (true);

else {
Serial.println("Time(s), Temp(C)");
while (addr <= 1024) {
t = t + 1;
EEPROM.get(addr, r);
addr = addr + 2;
v = r * 5.0 / 1024.0;
c = 100 * (v - 0.5);
Serial.print(t * 60);
while (true);

Maybe the below will help; getting rid of delay in favour of a millis based approach will be a first step.

Blink-without-delay example
Using millis() for timing. A beginners guide
Demonstration code for several things at the same time

And How to use this forum - please read., point 7 will help to post code properly on the forum.

If you have to blink a light in a room every minute and also, once an hour, check the mail. Do you hold your hand on the light switch and stare at the clock the entire time?


How would you deal with this in the "real world"? Write your code like that.

-jim lee