Open Willian-Zhang opened 6 years ago
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// print out the value you read:
long start = millis();
// put your main code here, to run repeatedly:
Serial.print(millis() - start);
Serial.print("\t");
Serial.print("0");
Serial.print("\t");
Serial.print(map(sensorValue, 0, 1023, 254, 0));
Serial.print("\n");
delay(1);
}