ACS 758 current sensor

I am working on ACS758 current sensor which I bought from robotshop. There is a simple code for this current sensor in robotshop. I want to make sure that Could I use this code to measure the current of an AC load by arduino UNO?, or it works just for DC loads? What changes I have to do in this code for AC loads?
the original code which is in website is:

[code]/*
50A Current Sensor(AC/DC)(SKU:SEN0098) Sample Code
This code shows you how to get raw datas from the sensor through Arduino and convert the raw datas to the value of the current according to the datasheet;
Smoothing algorithm (arduino.cc/en/Tutorial/Smoothing) is used to make the outputting current value more reliable;
Created 27 December 2011
By Barry Machine
www.dfrobot.com
Version:0.2

*/

const int numReadings = 30;
float readings[numReadings]; // the readings from the analog input
int index = 0; // the index of the current reading
float total = 0; // the running total
float average = 0; // the average

float currentValue = 0;

void setup()
{
Serial.begin(57600);
for (int thisReading = 0; thisReading < numReadings; thisReading++)
readings[thisReading] = 0;
}
void loop()
{
total= total - readings[index];
readings[index] = analogRead(0); //Raw data reading
readings[index] = (readings[index]-510)*5/1024/0.04-0.04;//Data processing:510-raw data from analogRead when the input is 0; 5-5v; the first 0.04-0.04V/A(sensitivity); the second 0.04-offset val;
total= total + readings[index];
index = index + 1;
if (index >= numReadings)
index = 0;
average = total/numReadings; //Smoothing algorithm (arduino.cc/en/Tutorial/Smoothing)
currentValue= average;
Serial.println(currentValue);
delay(30);
}[/code]

Thanks Carlos, the only problem is when I attach an AC load to sensor, I don’t see any change in currentvalue in serial monitor of arduino; which means there is no change in current with and without load. Did you test your code for an AC load?

The sensor should provide a voltage output proportional to the AC or DC current going trough it. Please read its documentation in order to understand how it functions and find some sample code.