led and lcd interfacing for glowing of street light

#include <SoftwareSerial.h>

int sensorPin = A0; // select the input pin for the LDR

int sensorValue = 0; // variable to store the value coming from the sensor

int led = 3;

void setup() { // declare the ledPin as an OUTPUT:

pinMode(led, OUTPUT);

Serial.begin(9600); }

void loop()

{

Serial.println(“Welcome to TechPonder LDR Tutorial”);

sensorValue = analogRead(sensorPin);

Serial.println(sensorValue);

if (sensorValue < 100)

{

Serial.println(“LED light on”);

digitalWrite(led,HIGH);

delay(1000);

}

digitalWrite(led,LOW);

delay(sensorValue);

}

Is there a question? Are the code tags coming soon?

void setup() { // declare the ledPin as an OUTPUT:

pinMode(led, OUTPUT);

Serial.begin(9600); }

It won't make any difference to the program, but why save space by putting { and } on the same line as code then wasting space by having blank lines ?

void setup()   // declare the ledPin as an OUTPUT:
{
  pinMode(led, OUTPUT);
  Serial.begin(9600);
}

uses no more lines but allows the code block associated with setup() to be clearly identified.

So, if the sensor value is greater than 100, tturn the LED off.

If it is less than 100, flash the LED with an uneven cycle: on for one second, off for a number of milliseconds equal to the sensor reading. For low sensor values, the "off" time will be undetectable and the led will look like it's continuously on.

Is this what you wanted your code to do?