I have something working now with a pot as my "sensor" I am getting a pretty interesting flickering wave effect. I've added delayMicroseconds; it helps a little. I might end up adding something where it just draws a line over the last position and see if that helps. Below is what I have so far.

#include <UTFT.h>

extern uint8_t SmallFont[];

UTFT myGLCD(ITDB32S, 38,39,40,41); // Remember to change the model parameter to suit your display module!

void setup(){

myGLCD.InitLCD();

myGLCD.setBackColor(50, 50, 50);

myGLCD.setFont(SmallFont);

}

double mD(double x, double in_min, double in_max, double out_min, double out_max)//Map double

{

return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;

}

void drawNeedle(int sensor,int pos_x, int pos_y){

myGLCD.setColor(125,255,255);

myGLCD.fillRect(50,50,150,150);

double pi = 3.14159265;

double x = 0; // setting variable to 0 is not needed, it will be written over anyways, it just looks good.

double y = 0;// same as above

double cur = mD(analogRead(sensor),0,1023,0,pi);

int rad = 50; // radius 50 pixels

x = pos_x + sin(cur + (pi/2)) * rad;

y = pos_y + cos(cur + (pi/2)) * rad;

myGLCD.setColor(255,0,0);

myGLCD.drawLine(pos_x,pos_y,x, y); // (cx, cy, calculated x, calculated y)

myGLCD.printNumF(cur,2,CENTER,10);//used for debugging

}

void loop(){

drawNeedle(0,100,100);

delayMicroseconds(30000);//Added to reduce flickering

}