int hold = 0; // Create "hold" and set to 0 for now int IR[700]; // Create a list of 700 integers; a list called IR. If you want to point to a certain area, you can say hold = IR[556], and hold will now hold the value in address 556 of IR. void setup() { // Start setting things up Serial.begin(9600); // Setup the serial monitor with a baud rate of 9600 pinMode(A2,OUTPUT); // Set A2 as an output. A2 connects to the GD pin of the IR clip digitalWrite(A2,LOW); // Set the GD pin to LOW to act as a ground delay(10); // Wait 10ms (optional) pinMode(A1,OUTPUT); // Set A1 as an output. This is connected to the 5v pin of the IR clip digitalWrite(A1,HIGH);// Set to high to provide a 5v power supply to the IR clip delay(1000); } void loop() { // Loop forever hold = analogRead(0); // Sample the A0 pin, which is connected to the IR output of the IR clip if(hold < 200){ // By default, A0 will read 5v/1023. If pulled to 0v, then we'll see an analog representation of less than 200, and we'll perform the following tasks: for(int i = 0 ; i < 700 ; i++){ // Do the following 700 times hold = analogRead(0); // Sample the A0 ADC pin and place the returned value into hold IR[i] = hold; // Place the value from hold into the area in the IR list pointed to by 'i' which increments every time this loop executes. // You could simplify things by doing this instead if you'd like: IR[i] = analogRead(0); } for(int i = 0 ; i < 700 ; i++){ // Once done, print the entire IR list to the serial monitor/plotter. Make sure to open your serial plotter under the tools menu Serial.println(IR[i]); // Print the value help in the IR address pointed to by 'i' } } } // This is the end of the loop.