create signal

Hi, i would like to know how can i create an internal signal on arduino board and then to to compare it with an analog signal input?

What kind of "internal signal"? Digital? Analog?

The analogRead function returns an integer value from 0 to 1023 that represents the ratio of the measured voltage to VRef.

It hardly seems necessary to "create an internal signal" to compare to an integer value. But, perhaps I am missing something.

I want a graduated signal(any voltage) which will compare with the analog and if e.g. the time 2 sec is less, will have the value 1 if it is more, the value 0.

The analog input for example will be 3,3 v and the internal 4 or 3.

Your questions don't make a lot of sense. Can ou tell us what you want to do, not how you think you want to do it?

So, i have one arduino. I connect pin 0 with 3v3(3,3v)to have an analog signal to test ok? I want to create a code on arduino so that to convert an analog signal to digital with delta modulation. Delta modulation is this i told you before, i have to create an internal signal and then to compare this with the analog. If the analog signal is more than the internal, we have the value 1 and if the analog signal is less than the internal, we have the value 0.So, the result is the digital modulated signal!

So, you want to turn a digital pin on (1) when the analogRead function returns a value above a threshold and off (0) when the analogRead function returns a value below the threshold.

What part of that are you having problems with?

How do you expect to synchronise your internal signal with your external one? Correlation?

here is my problem...i don't know how to connect them.....

Time to examine the characteristics of your signal.

``````int prevReading;
int delta;
int val;
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.println(delta);
delay(10);
}
``````

Here is a code i made but i stuck how to add the wright modulation....