sorry ,
ok here wat i do.. the circuit is here
and the code is
/*
Analog Input with prescale change
Reading a 1 kHz sine wave, 0 to 5 volts
Using analog 0
Results stored in memory for highest speed
using code from:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1208715493/11
with special thanks to jmknapp
*/
#define FASTADC 1
// defines for setting and clearing register bits
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
#ifndef sbi
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
#endif
int value[100]; // variable to store the value coming from the sensor
int i=0;
void setup()
{
Serial.begin(9600) ;
int start ;
int i ;
#if FASTADC
// set prescale to 16
sbi(ADCSRA,ADPS2) ;
cbi(ADCSRA,ADPS1) ;
cbi(ADCSRA,ADPS0) ;
#endif
}
void loop()
{
for (i=0;i<100;i++)
{
value[i]=analogRead(0);
}
for (i=0;i<100;i++)
{
Serial.println(value[i]);
}
Serial.println();
Serial.println();
Serial.println();
delay(5000);
}
now the result look like this (plot in excel )
. what im try to do is get the sinus graph from the ac supply. how can i do that.