How to Compile two codes; one making LEDs PWM the other give light intensity val

Hello Everyone,

I just bought the Uno this week. I am a newbie, really..

I Need to send trigger to a LED light system (10Hz with flash lasting 100µs) and at the same time I need to know the Light intensity of this LED system thanks to a Photo-resistor.

I already did find the code for both, but I don't know how to merge both code (if possible) for the arduino to execute both at the same time ...

Many thanks .

Salabert :art:

Please post the 2 codes. Be sure to use Code tags (looks like a paper scroll on the menu)

First code:

void setup() {
  // declare the LED pins as outputs
  pinMode(3, OUTPUT);
  }

void loop() {

  digitalWrite(3, HIGH); // turn the red LED on pin 4 on
        // wait for a quarter second before changing the light
     delayMicroseconds(100);
     

  digitalWrite(3, LOW);  // turn the red LED on pin 4 off
    // wait for a quarter second before changing the light
  delay(100);

  }

Second code;

/*
  AnalogReadSerial
  Reads an analog input on pin 0, prints the result to the serial monitor.
  Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
 
 This example code is in the public domain.
 */

// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  // print out the value you read:
  Serial.println(sensorValue);
  delay(1);        // delay in between reads for stability
}

Many thanks ! Have a good day.

SF