I've gotten rather excited recently about the wikireader since they
can be had for under $15, and this looks like an ideal platform to
make a nice touchscreen interface for home automation and other things
you might want to do with other open hardware like the Arduino.

I started by hooking up the serial port to a board with a PIC 
microcontroller with Ethernet, and thanks to the recent updates 
of the schematics, it appears I can power the PIC board I have
just fine (but it will probably eat batteries quickly). 

What I'm trying to figure out now is how to get some reasonable UI
abstraction layer that functions over serial. There are things like
https://www.sparkfun.com/products/10089 , which is a lot like what
I'd like, but I want to have a fully open protocol that the 
Wikireader hardware runs, draws buttons & graphs, and then responds
over serial when someone presses one of the buttons on the screen.

I started hacking up the wikireader/samo-lib/grifo/examples/lcd code
(diff attached later), and I can (using an ftdi serial), get stuff
to show up on the screen.

What I'd really like to be able to do though, is fix the simulator
code so I can try out UI protocol development without having to load
new code on an SDcard all the time. What I'm stuck with right now
is if I include console.h, and the console library, things work on
the real hardware, but the lcd/simulate version doesn't build, so I
need to figure out how to add that to both.

Has anyone else tried this out recently, and what would be a good
mailing list to get some technical discussions started again?

I've also wondered if I can do some hackery to have a PIC or arduino
'pretend' to be an SDcard, and then I could imagine a board that
would just plug right into a stock Wikireader SD card slot with
an adapter cable, and require no soldering or even opening of the 
case.

Thoughs anyway, or better ideas ?

Thanks
-- Troy


diff -r 8baa4bcce346 samo-lib/grifo/examples/lcd/lcd.c
--- a/samo-lib/grifo/examples/lcd/lcd.c	Tue Oct 30 10:02:23 2012 +0800
+++ b/samo-lib/grifo/examples/lcd/lcd.c	Sun Nov 04 23:20:17 2012 -0600
@@ -20,6 +20,7 @@
  */
 
 #include "grifo.h"
+#include "console.h"
 
 int grifo_main(int argc, char *argv[])
 {
@@ -28,55 +29,13 @@
 
 	int x;
 	int y;
+	int x1;
+	int y1;
+	int x2;
+	int y2;
 
 	debug_printf("lcd start\n");
 
-	debug_printf("black screen\n");
-	lcd_clear(LCD_BLACK);
-	delay_us(1000000);
-
-	debug_printf("plot white pixels\n");
-	for (x = 10, y = 10; x < 100; x += 5, y += 10) {
-		lcd_point(x, y);
-	}
-	delay_us(1000000);
-
-	debug_printf("draw white lines\n");
-	lcd_move_to( 10,  10);
-	lcd_line_to(120,  10);
-	lcd_line_to(120, 100);
-	lcd_line_to( 10, 100);
-	lcd_line_to( 10,  10);
-
-	lcd_move_to( 10,  10);
-	lcd_line_to(120, 100);
-	lcd_move_to(120,  10);
-	lcd_line_to( 10, 100);
-	delay_us(1000000);
-
-	debug_printf("white screen\n");
-	lcd_clear(LCD_WHITE);
-	delay_us(1000000);
-
-	debug_printf("plot black pixels\n");
-	for (x = 150, y = 140; x < 200; x += 10, y += 5) {
-		lcd_point(x, y);
-	}
-	delay_us(1000000);
-
-	debug_printf("draw black lines\n");
-	lcd_move_to( 10,  10);
-	lcd_line_to(120,  10);
-	lcd_line_to(120, 100);
-	lcd_line_to( 10, 100);
-	lcd_line_to( 10,  10);
-
-	lcd_move_to( 10,  10);
-	lcd_line_to(120, 100);
-	lcd_move_to(120,  10);
-	lcd_line_to( 10, 100);
-	delay_us(1000000);
-
 	debug_printf("eye pattern\n");
 	lcd_clear(LCD_WHITE);
 
@@ -94,90 +53,21 @@
 	debug_printf("text rows %d\n", lcd_max_rows());
 	debug_printf("text columns %d\n", lcd_max_columns());
 
-	debug_printf("positioned text\n");
-	lcd_clear(LCD_WHITE);
-	lcd_at_xy(20, 8);
-	lcd_print("one");
-	delay_us(500000);
-
-	lcd_at_xy(3, 1);
-	lcd_print("two");
-	delay_us(500000);
-
-	lcd_at_xy(0, 0);
-	lcd_print("A");
-	delay_us(500000);
-
-	lcd_at_xy(lcd_max_columns() - 1, lcd_max_rows() - 1);
-	lcd_print("Z");
-	delay_us(2000000);
-
-	debug_printf("black text\n");
-	lcd_clear(LCD_WHITE);
-	lcd_print("This the first is a line of text\n");
-	lcd_print("This the second is a line of text\n");
-	lcd_print("This the third is a line of text\n");
-	lcd_print("This the fourth is a line of text\n");
-	lcd_print("This the fifth is a line of text\n");
-	lcd_printf("some numbers: %d 0x%08x\n", 12345, 349599327);
-	delay_us(2000000);
-
-	debug_printf("white text\n");
-	lcd_clear(LCD_BLACK);
-	lcd_print("This the first is a line of text\n");
-	lcd_print("This the second is a line of text\n");
-	lcd_print("This the third is a line of text\n");
-	lcd_print("This the fourth is a line of text\n");
-	lcd_print("This the fifth is a line of text\n");
-	lcd_printf("some numbers: %d 0x%08x\n", 12345, 349599327);
-	delay_us(2000000);
-
-	debug_printf("mixed text\n");
-	lcd_clear(LCD_WHITE);
-	lcd_print("This the first is a line of text\n");
-	(void)lcd_set_colour(LCD_WHITE);
-	lcd_print("This the second is a line of text\n");
-	(void)lcd_set_colour(LCD_BLACK);
-	lcd_print("This the third is a line of text\n");
-	(void)lcd_set_colour(LCD_WHITE);
-	lcd_print("This the fourth is a line of text\n");
-	(void)lcd_set_colour(LCD_BLACK);
-	lcd_print("This the fifth is a line of text\n");
-	lcd_printf("some numbers: %d 0x%08x\n", 12345, 349599327);
-	delay_us(2000000);
-
-
-	debug_printf("scrolling text\n");
-	lcd_clear(LCD_WHITE);
-	for (x = 1; x <= 30; ++x) {
-		lcd_printf("line number: %d\n", x);
+	int done = 0;
+	int count = 0;
+	while (!done){
+		if (count > 10) {
+			lcd_clear(LCD_WHITE);
+			count = 0;
+		}
+		debug_printf("Enter chars for line\n");
+		x1 = console_input_char();
+		y1 = console_input_char();
+		x2 = console_input_char();
+		y2 = console_input_char();
+		lcd_move_to(x1, y1);
+		lcd_line_to(x2, y2);
+		count ++;
 	}
-	delay_us(2000000);
-
-
-	debug_printf("picture-in-picture\n");
-	lcd_clear(LCD_WHITE);
-	for (y = 0; y < lcd_max_rows(); ++y) {
-		lcd_at_xy(0, y);
-		lcd_printf("background line: %d", y);
-	}
-
-	lcd_window(15, 19, 17, 21);
-	lcd_window_clear(LCD_WHITE);
-	lcd_window_move_to(0,0);
-	lcd_window_line_to(16,0);
-	lcd_window_line_to(16,20);
-	lcd_window_line_to(0,20);
-	lcd_window_line_to(0,0);
-
-	for (x = 0; x < 10; ++x) {
-		debug_printf("picture-in-picture enable\n");
-		lcd_window_enable();
-		delay_us(1000000);
-		debug_printf("picture-in-picture disable\n");
-		lcd_window_disable();
-		delay_us(1000000);
-	}
-
 	return 0;
 }
_______________________________________________
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community

Reply via email to