int readPin = A0;
int readValue;
int redPin = 3;
int void setup() {
// put your setup code here, to run once:
pinMode(readPin, INPUT);
pinMode(redPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
readValue = analogRead(readPin);
Also, please, format your code and re-post your code using the < CODE > button in the message box... the result should look like this...
int readPin = A0;
int readValue;
int redPin = 3;
// int void setup() { // no!
void setup() { // yes!
// put your setup code here, to run once:
pinMode(readPin, INPUT);
pinMode(redPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
readValue = analogRead(readPin);
if (readValue < 920) {
digitalWrite(redPin, HIGH);
} else {
digitalWrite(redPin, LOW);
}
Serial.println(readValue);
delay(500);
}
OP also continues to publish in "Uncategorized." (category later changed, not by OP) Would an unresponsive user be treated as a bot (is there a provision in the rules)?