Sample code for AC current measurement_using Hall Effect sensor

float correction=0.1744;//determined by calibration
float kk=0.65;
int dcvolt=512;//2.5v=1/2 X 5v--1024bit
int offset=512;//512;//2.5v=1/2 X 5v--1024bit
float amp=0.0;
float ampmax=0.0;

void setup() {
Serial.begin(9600);
delay(2000);
}

void loop() {
delay(1000);
ampmax=0;//reset max value
for(int samp=0;samp<201;samp++)
{
ampmax=analogRead(1);//It takes about 100 microseconds (0.0001 s) to read an analog input;
//200 reading will take 20 ms--around 1 cycle of 60HZ signal
}
Serial.println(ampmax);
amp=(ampmax-offset);
//Serial.println(amp);
amp=amp*correction;//pay attention ampmax is the peak value
Serial.println(amp);
}
Hall Effect sensor used:Hall Effect Current Sensor For Hobbyist, Arduino Compatible, AC 75A DC 100A | eBay