Trammell Hudson avatar Trammell Hudson committed c01d226

12 hour display, but with seconds

Comments (0)

Files changed (1)

alphaclock_18_Rev1_0/alphaclock_18_Rev1_0.pde

 		}
 	}
 
+#if 0
 	const uint8_t pos = (SecNow * 2) / 15; // 0-7
 	const uint16_t rem = (SecNow * 2) % 15; // 0-15
 	const uint8_t old_on = (on_period * (16 - rem)) / 128; // fade fast
 		digit_write_pwm(NUM_DIGITS-1, SPINNER + pos, '_', on_period, off_period);
 		digit_write_pwm(NUM_DIGITS-1, SPINNER + (pos + 7) % 8, '_', old_on, old_off);
 	}
+#endif
 }
 
 
     else {
       // "Normal" time display:
       //display[0] = AMPM24HdisplayNow;
+#if 0
       //display[0] = (SecNow % 8) + 1 + 8  + '`'; // chaser
       display_char(0, HrNowTens + '0');
       display_char(1, HrNowOnes + '0');
-#if 0
       display_char(2, MinNowTens + '0');
       display_char(3, MinNowOnes + '0');
+      display_char(4, ' '); // leave blank for spinner
 #else
-	display_char(2, (SecNow / 20) + THIN_0);
-	display_char(3, (SecNow % 20) + THIN_0);
+	display_char(0, (HrNow % 12) + THIN_0);
+	display_char(1, (MinNow / 10) + '0');
+	display_char(2, (MinNow & 10) + '0');
+	display_char(3, (SecNow / 10) + '0');
+	display_char(4, (SecNow % 10) + '0');
 #endif
-      display_char(4, ' '); // leave blank for spinner
 
       // Leading-Zero blanking for 12-hour mode:
 
         display_char(0, ' ');
     }
 
-    // Add time delimiter (colon) for time display, whether that's "real" time or the alarm.
-    if (SecNow % 2)
+	// Add time delimiter (colon) for time display,
+	// whether that's "real" time or the alarm.
+	display_dots[0] = DOT_BOTTOM;
+	display_dots[1] = DOT_TOP;
+
+	// Make the second indicator blink
+	if (SecNow % 2)
 	{
-	    display_dots[1] = DOT_BOTTOM;
-	    display_dots[2] = DOT_TOP;
+		display_dots[2] = DOT_BOTTOM;
+		display_dots[3] = DOT_TOP;
 	} else {
-	    display_dots[1] = ' ';
-	    display_dots[2] = ' ';
+		display_dots[2] = ' ';
+		display_dots[3] = ' ';
 	}
 
-    if (AlarmEnabled)
-      display_dots[0] = DOT_TOP;
-    else
-      display_dots[0] = ' ';
+	if (AlarmEnabled)
+		display_dots[0] = DOT_BOTH;
+	else
+		display_dots[0] = DOT_BOTTOM;
   }
 
   // Time (or word) to display is now computed.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.