void setup() {
// put your setup code here, to run once:
Serial.begin(9600); //reads 9600 bits/sec
}
void loop() {
// put your main code here, to run repeatedly:
int sensorValue = analogRead(A0);
//reads sensor value from pin A0 which potentiostat is connected to
if (sensorValue > (1023/2)) {digitalWrite(8, HIGH);}
//if potentiostat over half of max value, LED on
if (sensorValue <= (1023/2)) {digitalWrite(8, LOW);}
//if potentiostat equal to/less than half max value, LED off
Serial.println(sensorValue);
//prints potentiostat value
delay(1000);
//delays program so that potentiostat value change is read every 1 second
}