1 /* Pong controller (for use with hPong)
6 int min = 65535, max = 0;
9 float val = 0, oldval = -255;
11 void setup() // run once, when the sketch starts
17 void loop() // run over and over again
19 val = analogRead(inpin);
22 val=(((val-(min))/(max-(min)))*stadium_max)-offset;
25 //Serial.print(min, DEC); Serial.print("-"); Serial.print(max, DEC); Serial.print("\n");
26 //Serial.print(val, DEC); Serial.print("\n");
27 Serial.print(val, BYTE);