Go Down

Topic: Stopwatch with Pause/Lap  6 digit 7 seg LED. HELP! (Read 129242 times) previous topic - next topic

CrossRoads

#165
Jan 24, 2011, 12:41 am Last Edit: Jan 24, 2011, 12:44 am by CrossRoads Reason: 1
You're very welcome Warren.

Why go down? Just hit reset and start readout from 0 again.

Well, if you must go down, replace the top of the memory_read code:

Lap#      address1      address2      address3      address4      address5      address6
1      0      1      2      3      4      5
2      6      7      8      9      10      11
3      12      13      14      15      16      17
:      :      :      :      :      :      :
83      492      493      494      495      496      497
84      498      499      500      501      502      503
85      504      505      506      507      508      509
86      510      511      512      513      514      515
// adjust reset # in EEPROM_writing to be 516, from 512

Code: [Select]

//Memory
//Memory Up Button Here

memory_up_button_state = digitalRead (memory_up_button);

if ((memory_up_button_state == 0 && running == 0)|| EEPROM_reading_up == 1){ // not running - button pushed, or already reading
 if (EEPROM_reading_up == 0){
   EEPROM_reading_up = 1; // enable reading
   //Serial.println ("EEPROM reading up enabled ");
   delay (300); // or set up something with millis() to keep from double reads
 }
}
//Memory Down Button Here (new code)

if ((memory_down_button_state == 0 && running == 0)|| EEPROM_reading_down== 1){ // not running - button pushed, or already reading
 if (EEPROM_reading_down == 0){
   EEPROM_reading_down = 1; // enable reading
   //Serial.println ("EEPROM reading down enabled ");
   delay (300); // or set up something with millis() to keep from double reads

   if (EEPROM_address == 6){
EEPROM_address = 510:
   }
   else{
     EEPROM_address = EEPROM_address -12;
   }

 }
}


if (EEPROM_reading_up == 1 || EEPROM_reading_down == 1){
 switch (byte_to_read){


continue with exisitng EEPROM reading code

If you want to write ( 255? ) to clear the memory with double button press &  hold, then will have to come up with something like the pause button with case statements, add in code to read the EEPROM to know when to stop writing, etc.
I was just thinking it would be neat to have the memory up or down button require 2 presses - 1st would display lap number (calculated from the start address being read), 2nd would display the time.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

You have to update EEPROM_reading to
EEPROM_reading_up & EEPROM_reading_down in presetup & in the stop/reset area as well, assign new pin #, etc.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

AWOL

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Coding Badly


To make the situation truly annoying, a few days ago I removed some spam from the "read only" area.

AWOL

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

CrossRoads

Wow - how'd this thread get pulled oved from the old forum?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Coding Badly


Let's continue here...
http://arduino.cc/forum/index.php/topic,77658.msg586626.html#msg586626

AWOL

Good idea - it's a bit spooky in here.   XD
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy