LIGHT SENSOR PROGRAM -NEWBIE HERE PLS HELP ME FIX THIS CODE THANKS IN ADVANCE

HELP ME FIX THIS CODE
when i run the code its said

Error compiling.

sketch_aug26a.ino; In function ‘void loop()’;
sketch_aug26a.ino;53;21; error; a function-definition is not allowed here before ‘{’ token
sketch_aug26a.ino;57;21; error; a function-definition is not allowed here before ‘{’ token
sketch_aug26a.ino;61;16; error; a function-definition is not allowed here before ‘{’ token
sketch_aug26a.ino;65;19; error; a function-definition is not allowed here before ‘{’ token
sketch_aug26a.ino;69;20; error; a function-definition is not allowed here before ‘{’ token
sketch_aug26a.ino;73;18; error; a function-definition is not allowed here before ‘{’ token
sketch_aug26a.ino;75;1; error; expected ‘}’ at end of input


int val = 0;
void setup()
{
Serial.begin(9600);
backlightOn();

}

void loop()
{
val = analogRead(0)/4.011764;
if (val > 252)  
{
selectLineOne();
delay(50);
Serial.print("It is very dark ");
selectLineTwo();
delay(50);
Serial.print("in this room.");
delay(100);
}
if (val > 246 && val < 252)
{
selectLineOne();
delay(50);
Serial.print("It is pretty   ");
selectLineTwo();
delay(50);
Serial.print("dark here.       ");
delay(100);
}
if (val > 235 && val < 246)
{
selectLineOne();
delay(50);
Serial.print("It is pretty     ");
selectLineTwo();
delay(50);
Serial.print("bright here.      ");
delay(100);
}
if (val < 235)
{
selectLineOne();
delay(50);
Serial.print("It is bright        ");
selectLineTwo();
delay(50);
Serial.print("in this room.      ");
delay(100);
}
}

void selectLineOne(){  //puts the cursor at line 0 char 0.
Serial.print(0xFE, BYTE);   //command flag
Serial.print(128, BYTE);    //position
}
void selectLineTwo(){  //puts the cursor at line 0 char 0.
Serial.print(0xFE, BYTE);   //command flag
Serial.print(192, BYTE);    //position
}
void clearLCD(){
Serial.print(0xFE, BYTE);   //command flag
Serial.print(0x01, BYTE);   //clear command.
}
void backlightOn(){  //turns on the backlight
Serial.print(0x7C, BYTE);   //command flag for backlight stuff
Serial.print(157, BYTE);    //light level.
}
void backlightOff(){  //turns off the backlight
Serial.print(0x7C, BYTE);   //command flag for backlight stuff
Serial.print(128, BYTE);     //light level for off.
}
void serCommand(){   //a general function to call the command flag for issuing all other commands   
Serial.print(0xFE, BYTE);
}
Serial.print(0x7C, BYTE)

What's a "BYTE"?

Two things: 1) Please don't SHOUT 2) Please use code tags when posting code.

  1. don’t modify the program and give us the error dump from the previous attempt.

im so sorry sir forgive me for my action im not shouting due to the caps letters its just urgent because its our school project im so so sorry it wont happen again sorry

im a newbie in arduino can you help me make a code using light sensor and LCD plsss. thanks hope to learn more on arduino

My PC monitor is an LCD.

Have you tried that? (your monitor, not mine, obviously)

Did you read reply #2? And . . ?

i dont have any idea on that program sir i just copy it with permission to the owner / i mean a program using a light sensor and outputs on the lcd screen - Arduino Light sensing module w/ LCD-Output

void setup()
{
  Serial.begin(9600);
  Serial.println ("Ready");
}

void loop()
{
  Serial.println (analogRead(0));
  delay (500);
}

thanks sir :) or in that previous program that i send can we? fix it or not sir? but thanks :open_mouth:

can i reply this link

https://www.youtube.com/watch?v=H1wwhJlwnWg pls check this if you have the code thanks

The video was too blurry. Have you got a serial LCD?

Sure you can fix the code you originally posted.

We're still waiting for your response to replies #2 and #5 of this thread.

we have a serial LCD sir in school but many students use it thats why we base on the errors in the arduino program if the program was successfully uploaded then our program has no errors thats why we are too hardly to learn we dont have much tools

I'm not sure I understood that.

Can you please provide responses to replies #2 and #5 of this thread.

yes sir i edited my post on reply #2 and that BYTE i dont have any idea either sorry

but pls watch this link if you have some codes to do this using a starter kit and a galileo shield thanks sir

https://www.youtube.com/watch?v=k7cut9H5qDM

Change everything that looks like this

Serial.print(0x7C, BYTE);

to Serial.write(0x7C);

(though not 0x7c in every case, obviously)

If this is a school project, why aren't you asking your teachers?

im asking for help on others beacuse our teachers challenge us but thanks sir

last question sir do you a program project using light sensor using the galileo starterkit and shield? Code? thanks

I don't have a Galileo. Please stop calling me sir.

sorry im just respecting because you have a high rank in this forum

I'm the janitor