Delta modulation

Hi to everyone, i want to make an analog to digital arduino converter with delta modulation but i stuck with the code and specific with the delta modulation code.Any ideas???I send data to the computer and graph it in Processing. :-?

At the simplest, delta modulation is simply recording the differences between consecutive samples.

yes but i can't find the code so that using him on arduino and then to graph the results in Processing.

yes but i can't find the code so that using him on arduino and then to graph the results in Processing.

Well, the Arduino IDE has this really neat feature. It's called a text editor.

Start typing.

Sorry my friend for my english but i am from Greece, and what i have to do to the text editor?Start typing what?i know the simply code analog to digital convert but i don't know how to add delta modulation..i hope that you understanding me..

void setup() {
// initialize the serial communication:
Serial.begin(9600);
}
this code is for analog-to-digital on arduino
void loop() {
// send the value of analog input 0:
Serial.println(analogRead(A0));
// wait a bit for the analog-to-digital converter
// to stabilize after the last reading:
delay(10);
}

this is the processing.serial.*;

Serial myPort; // The serial port
int xPos = 1; // horizontal position of the graph

void setup () {
// set the window size:
size(400, 300);

// List all the available serial ports
println(Serial.list());
// I know that the first port in the serial list on my mac
// is always my Arduino, so I open Serial.list()[0].
// Open whatever port is the one you're using.
myPort = new Serial(this, Serial.list()[0], 9600);
// don't generate a serialEvent() unless you get a newline character:
myPort.bufferUntil('\n');
// set inital background:
background(0);
}
void draw () {
// everything happens in the serialEvent()
}

void serialEvent (Serial myPort) {
// get the ASCII string:
String inString = myPort.readStringUntil('\n');

if (inString != null) {
// trim off any whitespace:
inString = trim(inString);
// convert to an int and map to the screen height:
float inByte = float(inString);
inByte = map(inByte, 0, 1023, 0, height);

// draw the line:
stroke(127,34,255);
line(xPos, height, xPos, height - inByte);

// at the edge of the screen, go back to the beginning:
if (xPos >= width) {
xPos = 0;
background(0);
}
else {
// increment the horizontal position:
xPos++;
}
}
}

*/

int currReading;
int prevReading = 0;
void setup()
{
 // initialize the serial communication:
 Serial.begin(9600);
}
// this code is for analog-to-digital on arduino
void loop()
{
 // send the value of analog input 0:
 currReading = analogRead(0);
 int delta = currReading - prevReading;
 Serial.println(delta);

 prevReading = currReading;
 // wait a bit for the analog-to-digital converter
 // to stabilize after the last reading:
 delay(10);
}

A0 is an alias to use when using an analog pin as a digital pin. That is not what you are doing. The correct pin number is 0, so I changed the pin number.

This code sends to the serial port the difference between the current reading and the previous reading.

If that is not what you want, you'll need to try again to explain what you mean by delta modulation.

thank you man,i am going to test it and i will tell you!!

ok my friend that's it!!!thank you vrey much!!!!!