View difference between Paste ID: w9QijJEq and q270XcQv
SHOW: | | - or go back to the newest paste.
1-
double values[15];
1+
2
double tip=0;
3
double last=0;
4
double realVoltage=0;
5-
int j=0;
5+
6
   Serial.begin(9600);
7
   Serial.println("Serial Started w00t");
8
   last=analogRead(0);
9
}
10
11
void loop(){
12
  tip=analogRead(0);
13-
  if(tip>50){ 
13+
  if(tip>50){
14
         Serial.print("Incoming Voltage is ");
15
         Serial.println(tip);
16-
         
16+
17-
         if(firstRun){
17+
         last=last+((tip-last)/5);
18-
           for(int i=0;i<15;i++){
18+
         Serial.print("avg voltage is ");
19-
	    values[i]=tip;
19+
         Serial.println(last);
20-
           }
20+
         realVoltage = ((last*6.83593)/1000); // 7k/5k*5000mV/1024
21-
           delay(4000);
21+
22-
           firstRun=false;
22+
23-
         }
23+
  }
24-
         values[j]=tip;
24+