How to run the multiple void with different delay/different timer

Iam from Indonesia and Iam newbe as Arduino user. Now I build the device, it is a 220Vac Dimmer which controlled by LDR (Light Dependent Resistor) got it from http://wiki.dxarts.washington.edu/groups/general/wiki/4dd69/AC_Dimmer_Circuit.html and it’s working perfectly. But I have a difficulty in “how to displaying the Voltage, current and the power” which are flowing to the controlled lamp.

After Iam trying to making a sketch for displaying them (Volt, Ampere and power) with delay 500ms (to make analog read not free running) it’s influence to the dimmer.
the dimmer to be stepping every 500ms and not liniarly more.

Iam already use the scheduler.h but so many error with that library.

So please help how to make sketch to displaying Volt, Amp, and power separately with “void loop” for the dimmer.

acdimmer_pot.ino (4.49 KB)

This

delay(500);

is going to cause you problems. Find the Blink Without Delay example. Learn it. Use it. Get rid of all calls to delay(…).

delay(…) is not compatible with any program that is attempting to do something in real time.

The calls to analogRead() are going to cause similar problems but analogRead() is so quick compared to delay(500) that you may not notice it.