HELP Arduino + Processing + Light Sensor

Hello everyone! I'm new on programming and especially on arduino, and I'd like to ask for help for a project for an academic exam, in which I use Arduino, Processing and light sensors (Sensore di luce, 3 pin, sensore di luminosità, LM393 per Arduino : Amazon.it: Commercio, Industria e Scienza). I'm desperate, I did several searches online but I can't find anything that can help me.

The project consists in starting videos thanks to the use of 3 brightness sensors connected to arduino. I managed to get the Arduino code to communicate with the Processing code but the moment I start the program from Processing I still don't see the brightness sensor, and consequently the video to which it should be connected (as if it were a button ) it will not start. Unfortunately I can't understand exactly what I'm doing wrong. Can you help me? I'm placing the code of both Arduino and Processing


Arduino:

#define LDRpin1 A0
int ledPin = 13;
// PIN VALUE
int LDRValue1 = 0;
int threshold = 500;
void setup () {
Serial.begin (9600);
pinMode (LDRpin1, INPUT);
pinMode (ledPin, OUTPUT); // try to see if the sensor works
}
void loop () {
LDRValue1 = analogRead (LDRpin1);
Serial.print (LDRValue1);
Serial.print ("this");
if (LDRValue1> threshold) {// if the pin threshold is lower than the given threshold (500)
String command = Serial.readStringUntil ('n');
digitalWrite (LDRValue1, command == "on");
digitalWrite (ledPin, HIGH); // the LED lights up
} else {
digitalWrite (ledPin, LOW); // the LED goes off
}
delay (100);
}

Processing:

import cc.arduino.*;
import org.firmata.*;
import processing.serial.*;
import processing.video.*;
// ARDUINO// 
Serial arduinoPort;
int LDRpin1 = 0; // why connected to A0 - arduinoInputVideo1
// int arduinoInputVideo2, arduinoInputVideo3;int digitalValue;
int threshold = 500;
Arduino Arduino;
//VIDEO
Movie Video1;//#1
Movie Video2;//#2 
Movie Video3;//#3
 //DATE
boolean Vid1 = false;
boolean Vid2 = false;
boolean Vid3 = false;
void setup () {
size (1280, 720);
background (0);
// arduinoPort = new Serial (this, Serial.list () [2], 9600);
arduino = new Arduino (this, Arduino.list () [2], 9600); 
arduinoarduino.pinMode (LDRpin1, Arduino.INPUT);
Video1 = new Movie (this, "video1.mp4");
Video2 = new Movie (this, "video2.mp4");
Video3 = new Movie (this, "video3.mp4");
}
void draw () {
digitalValue = arduino.analogRead (LDRpin1);
if (digitalValue> threshold) {
Vid1 = true;
Vid2 = false;
Vid3 = false;
println ( "VideoPlaying1");
}else {
background (178.34,34);
}
// VIDEO1
if (Vid1) {
Video2.stop ();
Video3.stop ();
Video1.play ();
image (Video1, 0, 0, width, height);
}
// VIDEO2
if (Vid2) {
Video1.stop ();
Video3.stop ();
Video2.play ();
image (Video2, 0, 0, width, height);
}
// VIDEO3
if (Vid3) {
Video1.stop ();
Video2.stop ();
Video3.play ();
image (Video3, 0, 0, width, height);
}
}
void movieEvent (Movie m) {
m.read ();
}
void keyPressed () {
// # 1
if (key == '1') {
Vid1 = true;
Vid2 = false;
Vid3 = false;
}
//#2
if (key == '2') {
Vid1 = false;
Vid2 = true;
Vid3 = false;
}
// # 3
if (key == '3') {
Vid1 = false;
Vid2 = false;
Vid3 = true;
}
}

Also posted in Italian.

How is this a bootloader issue?

yeah sorry, I hope I can get a reply from someone, I really need help.

TheMemberFormerlyKnownAsAWOL:
How is this a bootloader issue?

sorry what's a bootloader issue? I don't think I know that

Another cross post deleted.

@Sadao, you were already informed (Problema con Arduino + Processing + Sensore di luminosità - #2 by gpb01 - Software - Arduino Forum) that cross posting is against the rules, yet you did it again. This is your last warning. If you cross post again I'm going to give you an account suspension.

Sadao:
sorry what's a bootloader issue? I don't think I know that

Don't you think you should have found that out before posting to the "Avrdude, stk500, Bootloader issues" section of the forum (I've since moved the topic)? It has the description: "Problems related to uploading your compiled sketches", yet you haven't mentioned any problems with uploading.