I share with you a project for light lamp with a light sensor

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);

if (readValue < 920) {
digitalWrite(redPin, HIGH);
} else {
digitalWrite(redPin, LOW);
}
Serial.println(readValue);
delay(500);
}

This is not correct. The standard is void setup()

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);
}

Hello, do yourself a favour and please read How to get the best out of this forum and post accordingly (including code with code tags).

Do you have a question or you felt happy with the code and wanted to just share?

Hi, @polis_12
How many projects do you have going?
Have you not learnt how to post code by now?

And in none of them have you reponded?

Tom.. :smiley: :+1: :coffee: :australia:

1 Like

nor has he/she fixed the code tags...

another entry in the ignore list soon...

1 Like

OP Just invented the wheel .... again.

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)?

Indeed s/he has 3 dumb posts... seems like a bot...

I'll report to moderation.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.