GLCD graphing problem

Hello

Im trying to get a GLCD to draw a graph off an analong in pin. but i cant get it to work.. so i tryed to remove all of the code and just get the base code working.. but i still get nothing.. i don't know if anyone can give me a hand.

what im trying to do is an oscilloscope. and this is what i got.
and what i try to do is make it draw a dot on (x,y) of a sin
but i don't get anything.
any help would be great.

#include <ks0108.h>
#include <arial14.h>

#define scale 10
#define top 50

const int MAX_X = 70;
const int ad_in = 5; //analog in pin 5
double y = 0;
double r = 0;
double x = 0;
int set_i = 0; // point on grid

byte data [4][MAX_X];
byte sample=0;

void setup(){
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
GLCD.Init(NON_INVERTED);
GLCD.ClearScreen();
GLCD.SelectFont(Arial_14);
}

void loop(){
for (x=0;x<=MAX_X;x++){
for(r=0;r<=360;r++){
GLCD.SetDot(x,r,BLACK); // draw on point
GLCD.GotoXY(75,30);
GLCD.PrintNumber(r);
GLCD.GotoXY(75,60);
GLCD.PrintNumber(x);
delay(50);
} GLCD.ClearScreen();
}

}

how is your LCD wired?

oh i forgot to say the screen work fine i test it with some test code and it works.

on and how do you use the SIN math function?

oh i forgot to say the screen work fine i test it with some test code and it works.

Perhaps you should post the code that works, so that we can (help you) compare the two versions to see what is missing from the non-working code.

on and how do you use the SIN math function?

I checked. Google is working today.

the sample code i got was from this site. Arduino Playground - GLCDks0108

#include <ks0108.h> // library header
#include <Arial14.h> // font definition for 14 point Arial font.
#include "SystemFont5x7.h" // system font
#include "ArduinoIcon.h" // bitmap
unsigned long startMillis;
unsigned int iter = 0;
void setup(){
GLCD.Init(NON_INVERTED); // initialise the library
GLCD.ClearScreen();
GLCD.DrawBitmap(ArduinoIcon, 32,0, BLACK); //draw the bitmap at the given x,y position
delay(3000);
GLCD.ClearScreen();
GLCD.SelectFont(System5x7); // select fixed width system font
}
void loop(){ // run over and over again
startMillis = millis();
while( millis() - startMillis < 1000){ // loop for one second
GLCD.DrawRect(0, 0, 64, 61, BLACK); // rectangle in left side of screen
GLCD.DrawRoundRect(68, 0, 58, 61, 5, BLACK); // rounded rectangle around text area
for(int i=0; i < 62; i += 4)
GLCD.DrawLine(1,1,63,i, BLACK); // draw lines from upper left down right side of rectangle
GLCD.DrawCircle(32,31,30,BLACK); // draw circle centered in the left side of screen
GLCD.FillRect(92,40,16,16, WHITE); // clear previous spinner position
GLCD.CursorTo(5,5); // locate curser for printing text
GLCD.PrintNumber(++iter); // print current iteration at the current cursor position
}
// display number of iterations in one second
GLCD.ClearScreen(); // clear the screen
GLCD.CursorTo(13,2); // positon cursor
GLCD.Puts("FPS= "); // print a text string
GLCD.PrintNumber(iter); // print a number
}

what i cant get to work is the SIn or cos function in the arduino code
it just dose not do any..

Where are you using sin() or cos()?

They are both in the Reference section:

http://arduino.cc/en/Reference/Sin
http://arduino.cc/en/Reference/Cos

what i cant get to work is the SIn or cos function in the arduino code
it just dose not do any..

There is no call to Serial.begin() in your code. There are no calls to Serial.print() or Serial,println() in your code. There are no calls to sin() or cos() in your code.

It would appear that the last omission explains your main problem.

It would also appear as though you are not really interested in trying to debug the problem yourself.

ok.. i trying to do debug but i don't know much of C programming. i started with a bigger program but it wasn't working. so i remove everything do get to the main thing i want. is to make and osilsocpe. i got the program to draw a graph but what im having a lot of problem is with getting a scale. like 0 volt starting at the bottom and having 5 volt at the top. how would i write that in to code? and also want to be able to change the scale.

Use analogRead() to get current voltage into a variable.
Use map() to scale variable to your screen height.
Plot point.

Just as an FYI
you should consider upgrading to the v3 version of the library.
You can find the link to the thread about it on the ks0108 playground page.
It is much faster and has several additional examples and fonts
and works with Arduino 1.0

--- bill