Woot!
I have a very-ghetto "Etch-a-Sketch" sketch at the moment! Complete with X and Y indicator!
/*
Nokia LCD Demo - A demo using the NokiaLCD library for a Nokia LCD with the epson driver.
Created by Thomas Jespersen, July 2009 (Originally Arduino Sketch by Gravitech.us)
Released into the public domain.
Edit by CaptainObvious - Ghetto Etch A Sketch
*/
#include <NokiaLCD.h>
// Nokia LCD Setup settings
#define RED 0xE0
#define GREEN 0x1C
#define BLUE 0x03
#define YELLOW 0xFC
#define MAGENTA 0xE3
#define CYAN 0x1F
#define BLACK 0x00
#define WHITE 0xFF
NokiaLCD nokiaLcd;
int potPin = 2; // X Position
int potPin2 = 3; // Y Position
int lcdDraw = 0;
int lcdDraw2 = 0;
char analogString[4];
char analogString2[4];
void setup()
{
DDRD |= B01111100; // Set SPI pins as output
PORTD |= B01111100; // Set SPI pins HIGH
nokiaLcd.lcd_init();
delay(500);
}
void loop()
{
char text [50]; // Not 100% sure if this is text size or what
analogRead(potPin);
analogRead(potPin2);
itoa(lcdDraw, analogString, 10); // Not really sure what itoa is, but it's important!
itoa(lcdDraw2, analogString2, 10);
strcpy(text, analogString); // First pot # input, printed in BLUE
nokiaLcd.lcd_draw_text(BLUE, BLACK, 100, 115, text);
strcpy(text, analogString2); // Second pot # input, printed in RED
nokiaLcd.lcd_draw_text(RED, BLACK, 100, 105, text);
lcdDraw = analogRead(potPin)/8;
lcdDraw2 = analogRead(potPin2)/8;
nokiaLcd.LCD_put_pixel(RED, lcdDraw, lcdDraw2);
}
Will be adding a button to clear screen shortly, and when it shows the position, once it's above 100, 3 Digit spots open, and the last digit is filled with a 0 if it's below 100. So anything that's < 100, will show up as "990" when it should be 99, "420" when it should be 42, etc.
But other than that, I can't thank you enough Thomas!
I'm also hoping to add a menu option, be able to choose etch a sketch or a couple other ideas, but first things first!
Much appreciative,
Captain O!