Commits

Trammell Hudson committed 9a7dd40

buzz and bargraph works

Comments (0)

Files changed (1)

interval/src/interval.c

 		{
 			remaining = -remaining;
 			walk = 1;
+			vibes_long_pulse();
 		} else {
 			walk = 0;
+			vibes_double_pulse();
 		}
-
-		// should buzz
 	}
 
-	remaining_buffer[0] = '0' + (remaining / 100) % 10;
-	remaining_buffer[1] = '0' + (remaining / 10) % 10;
-	remaining_buffer[2] = '0' + (remaining / 1) % 10;
-	remaining_buffer[3] = '\0';
+	int min = remaining / 60;
+	int sec = remaining % 60;
+
+	if (walk)
+	{
+		text_layer_set_text_color(&remaining_layer, GColorBlack);
+		text_layer_set_background_color(&remaining_layer, GColorWhite);
+	} else {
+		text_layer_set_text_color(&remaining_layer, GColorWhite);
+		text_layer_set_background_color(&remaining_layer, GColorClear);
+	}
+
+	remaining_buffer[0] = '0' + (min / 10) % 10;
+	remaining_buffer[1] = '0' + (min / 1) % 10;
+	remaining_buffer[2] = ':';
+	remaining_buffer[3] = '0' + (sec / 10) % 10;
+	remaining_buffer[4] = '0' + (sec / 1) % 10;
+	remaining_buffer[5] = '\0';
 
 	text_layer_set_text(&remaining_layer, remaining_buffer);
 
 
 	resource_init_current_app(&RESOURCES);
 
-
-	text_layer_init(&time_layer, GRect(20,00,100,30));
-	text_layer_init(&remaining_layer, GRect(30,28,104,48));
+	text_layer_init(&time_layer, GRect(30,-3,100,30));
+	text_layer_init(&remaining_layer, GRect(7,26,132,44));
 
 	text_layer_set_text_color(&time_layer, GColorWhite);
-	text_layer_set_text_color(&remaining_layer, GColorWhite);
         text_layer_set_background_color(&time_layer, GColorClear);
-        text_layer_set_background_color(&remaining_layer, GColorClear);
 
 	text_layer_set_text(&time_layer, "");
 	text_layer_set_text(&remaining_layer, "");
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.