Commits

Trammell Hudson committed f3213a8 Draft

scrolls a message

Comments (0)

Files changed (1)

 #define RD	0xC7
 #define CLKSEL	0xD6
 
+static const char numbers[][16] = {
+	"one",
+	"two",
+	"three",
+	"four",
+	"five",
+	"six",
+	"seven",
+	"eight",
+	"nine",
+	"ten",
+	"eleven",
+	"twelve",
+	"thirty",
+	"fourteen",
+	"fifteen",
+	"sixteen",
+	"seventeen",
+	"eightteen",
+	"nineteen",
+	"twenty",
+	"twenty one",
+	"twenty two",
+	"twenty three",
+	"twenty four",
+	"twenty five",
+	"twenty six",
+	"twenty seven",
+	"twenty eight",
+	"twenty nine",
+};
 
 
 static void
 	out(WRCE, 1);
 }
 
+
+static char output[64];
+
 int
 main(void)
 {
 
 	send_str(PSTR("alphawatch\r\n"));
 	uint32_t ticks = 0;
-	
+
+	strcpy(output, "      the quick brown fox jumps over the lazy dog      ");
+	uint16_t offset = 0;
+
 	while (1)
 	{
 		int c = usb_serial_getchar();
 		if (bit_is_set(TIFR0, OCF0A))
 		{
 			sbi(TIFR0, OCF0A); // reset the bit
+			static uint8_t rate = 0;
+			if ((rate++) < 40)
+				continue;
+			rate = 0;
+
 			// do periodic stuff;
+			for (int i = 0 ; i < 8 ; i++)
+			{
+				char c = output[offset + i];
+				if (c == '\0')
+				{
+					offset = 0;
+					c = ' ';
+				}
+			
+				lcd_write(CHAR_RAM + i, c);
+			}
+
+			offset++;
 		}
 
+/*
 		ticks++;
 		lcd_write(CHAR_RAM | 7, hexdigit(ticks >> 0x00));
 		lcd_write(CHAR_RAM | 6, hexdigit(ticks >> 0x04));
 		lcd_write(CHAR_RAM | 2, hexdigit(ticks >> 0x14));
 		lcd_write(CHAR_RAM | 1, hexdigit(ticks >> 0x18));
 		lcd_write(CHAR_RAM | 0, hexdigit(ticks >> 0x1C));
+*/
 	}
 }
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.