1 millisecond light pulse LED.

Hello friends!

I’m a beginner in Arduino Uno and I’m having trouble making a Project.
I have a Digital Camera Sony DSC Rx10 Mark II. That camera captures Ultra Slow Motion frames (up to 1 milliseconds) and my Project is to make an LED diode that have one-thousandth of a second light oscillations so that only my Camera can “see” the Oscillations.
The idea is to make that every 1 second the LED blinks for 1/1000 (one millisecond) of a second and after every blink the LED diode turns off for a period of one second and blink again during the period of one thousandth of a second, in an infinite loop of luminous oscillations each second and that only a Camera that makes videos in Ultra Slow Motion like mine Sony DSC RX10 could record the oscillations (it will looks like to the human eye that the LED diode is always off).
I’d like to know how I could do this Project. I already used the “delay” command but it did NOT work for my Project. I already hear that the “delay” time command is terrible for time precision less than 50 milliseconds…
Please, watch the sketch that I used for my Project:

void setup ( ) {

pinMode (10, OUTPUT);

}

void loop ( ) {

digitalWrite (10, HIGH);
delay (0001);
digitalWrite (10, LOW);
delay (1000);

}

I thought that these commands would make my LED blink for a millisecond every 1 second (as I want it to happen) but what actually happened was that the LED blinked in a time just around 1/50 of a second.
The “delay” option disappointed me very much in this Project…

Please, help me with this Arduino Project!

How do you plan on synchronising the electronic shutter with the flash?

delay (0001);Is it important that the delay is expressed as an octal constant?

what actually happened was that the LED blinked in a time just around 1/50 of a second.

You measured this with what?

Please remember to use code tags when posting code.

AWOL:
How do you plan on synchronising the electronic shutter with the flash?

I don't want to take a photo of the light oscillation. I want to make a Ultra Slow Motion video to see the light oscillation. It's different.

delay (0001);Is it important that the delay is expressed as an octal constant?

About the time "delay (0001)", What's the FIRST thing I said on the topic? I'm a BEGINNER. So I don't have much knowledge on Arduino. More attention to read the topic, please.

More attention to read the posting guidelines, please.

Out.

I already hear that the "delay" time command is terrible for time precision less than 50 milliseconds...

You're just making stuff up.

You measured this with what?

Still waiting for an answer.

AWOL:
You're just making stuff up.
Still waiting for an answer.

Man, this is a Forum for Learning and Teaching about the Arduino. But it seems that your only goal at least in this topic is to show your personal opinions, question me about everything I wrote and try to annoy me.
Have a little humility, you were not born knowing how to program. And if you do not know how to help me, do not bother me either.

jean_kleber:
Man, this is a Forum for Learning and Teaching about the Arduino. But it seems that your only goal at least in this topic is to show your personal opinions, question me about everything I wrote and try to annoy me.
Have a little humility, you were not born knowing how to program. And if you do not know how to help me, do not bother me either.

Well then, where did you hear "that the "delay" time command is terrible for time precision less than 50 milliseconds... " because it's not true and none of us have ever heard it.

Where did you make up (sorry, I mean hear) that 1mS pulses will be invisible to the human eye?

And as AWOL has asked several times, what makes you think your light is on for 50mS? I'd say if you're running that sketch, it's doing fairly close to what you said it is.

Ok, show me where it says delay() is inaccurate for delays of less than 50ms.
This learning and teaching thing is a two-way process.

I’m still waiting for an answer to my question about how you measured 1/50th of a second.

I am trying to help you, by identifying the source of your observations and misconceptions, but you’re not making it easy for me to help.
(Sorry, but I don’t do humility)

AWOL:
Ok, show me where it says delay() is inaccurate for delays of less than 50ms.
This learning and teaching thing is a two-way process.

This theory I heard from an assistant under the supervision of one of the most famous Electrical Engineers in Latin America, Mr. Newton C. Braga. When I say “I heard” it’s because I really HEARD from his mouth, not that I read somewhere on the internet! According to him, the delay commands do not have 100% accuracy because it takes a while for the information from the commands to arrive at the Arduino and to Arduino process the informations. I at no time did I said that this assertion of Newton C. Braga’s assistant is correct or incorrect! So I just said, “I heard.”

I’m still waiting for an answer to my question about how you measured 1/50th of a second.

For someone who thinks are so smart you insist a lot on a question whose answer is obvious, because your answer is in the text I wrote. Through a simple recording using my Ultra Slow Motion Camera I can calculate through the frames per second of a video what is the speed of execution of a command. This is so obvious that it gets annoying to have to explain. I confess that I did not have time to make a calculation with 100% accuracy, but I assure you that if you put the command “delay (1)” you will see that it is obvious that the LED is not blinking at a speed of just one millisecond. Just do it if you don’t believe me.

Oracle:
Well then, where did you hear "that the "delay" time command is terrible for time precision less than 50 milliseconds... " because it's not true and none of us have ever heard it.

Where did you make up (sorry, I mean hear) that 1mS pulses will be invisible to the human eye?

And as AWOL has asked several times, what makes you think your light is on for 50mS? I'd say if you're running that sketch, it's doing fairly close to what you said it is.

Are you here to help or criticize? You wrote a lot of things but so far no word about a possible solution. I'm feeling like I'm being interviewed by some annoying reporter...
So many questions and absolutely NO help.

jean_kleber:
Are you here to help or criticize? You wrote a lot of things but so far no word about a possible solution. I'm feeling like I'm being interviewed by some annoying reporter...
So many questions and absolutely NO help.

How can you expect help when you can't provide the needed information?

Your sketch will blink the led for 1mS every 1.001 seconds. That is probably what you're device is doing. And that is all anyone can tell you based on the information you're willing to share.

This theory I heard from an assistant under the supervision of one of the most famous Electrical Engineers in Latin America, Mr. Newton C. Braga. When I say "I heard" it's because I really HEARD from his mouth, not that I read somewhere on the internet! According to him, the delay commands do not have 100% accuracy because it takes a while for the information from the commands to arrive at the Arduino and to Arduino process the informations. I at no time did I said that this assertion of Newton C. Braga's assistant is correct or incorrect! So I just said, "I heard."

Try talking to a software engineer, not some random sparky.
You're absolutely correct that the delay function is not 100% accurate, but that is no reason to rubbish it in the way, and to the extent, that you did.

For someone who thinks are so smart you insist a lot on a question whose answer is obvious, because your answer is in the text I wrote.

Unless and until you put an oscilloscope probe, connected to a calibrated oscilloscope, on pin 10 of your Arduino Uno (preferably under the direct supervision of Newton C. Braga), and describe to me the resulting waveform, I will remain of the opinion that you haven't a clue what you're doing.
Please don't take this as a criticism; it's only my opinion, backed by a great deal of experience of microcontrollers and imaging systems.(I'm guessing that your camera outputs 50Hz video. That was a hint. If you need further help, can I suggest you post in the Portuguese section of the forum?)

void setup ( )  {

   pinMode (10, OUTPUT);
  Serial.begin (9600);
}

void loop ( )  {

 digitalWrite (10, HIGH);
  unsigned long start = micros();
 delay (0001);
  unsigned long end = micros();
 digitalWrite (10, LOW);
Serial.print(F("Approx delay time in microseconds "));
 Serial.println (end - start);
 delay (1000);

}

(uncompiled, untested)
Now before you say the method is flawed, remember that :
A) it is repeatable by anyone, even if they don't have a scope or fancy Sony camera (though, unfortunately, not me, because I'm 400 km from my Arduinos)
B) because the baud rate is ultimately derived from the same source as the timers used for delay (namely the 16MHz resonator) if there is any gross inaccuracy, you won't see anything valid in the serial monitor.

AWOL:
Try talking to a software engineer, not some random sparky.
You’re absolutely correct that the delay function is not 100% accurate, but that is no reason to rubbish it in the way, and to the extent, that you did.
Unless and until you put an oscilloscope probe, connected to a calibrated oscilloscope, on pin 10 of your Arduino Uno (preferably under the direct supervision of Newton C. Braga), and describe to me the resulting waveform, I will remain of the opinion that you haven’t a clue what you’re doing.
Please don’t take this as a criticism; it’s only my opinion, backed by a great deal of experience of microcontrollers and imaging systems.(I’m guessing that your camera outputs 50Hz video. That was a hint. If you need further help, can I suggest you post in the Portuguese section of the forum?)

That’s ok. I solved the problem using the command “delayMicroseconds” (I did not know about the existence of this command) anyway, thanks for the attention.

No, not good enough.
Post your code and your observations.

AWOL:
No, not good enough.
Post your code and your observations.

Well, I just used a red led and I made a single change in the sketch. The light pulse is faster than the perception threshold of the human eye, but I was able to film with the Slow Motion Camera because apparently the common LED keeps the power of the Arduino’s command for a much longer time than the speed of the command. Through this I came to the realization that the “problem” was not in the Arduino but in the common LED that was not made for this type of experiment. But I’m relieved to have worked.
This is the new sketch:

void setup ( ) {

pinMode (10, OUTPUT);

}

void loop ( ) {

digitalWrite (10, HIGH);
delayMicroseconds (5);
digitalWrite (10, LOW);
delay (1000);

}

It worked to me.