Wanting to read a pattern from Serial Monitor from data coming from a sensor

Hey i'm pretty new to this so im seeking out for some help. Im using a photodiode which is reading a blinking light from another board. When the light on the board blinks twice i want a light to turn on. Is there a way to read a pattern from the serial monitor from the data that the photodiode is getting or will i have to do something else to when that light blinks twice an LED comes on.

Hello alr21
Post your sketch, well formated, with comments and in so called code tags "</>" and schematic, not a Fritzy diagram, to see how we can help.
Have a nice day and enjoy coding in C++.

One approach is to use millis() to measure the time between blinks, and if it is "short enough", do something.

Post the code, and tell us more about your setup.

The problem and the solution are contained in the definition of "blinks twice" :slight_smile:

Successfully?

Is there a way to read a pattern from the serial monitor from the data that the photodiode is getting

I have no idea what you are talking about. You need to explain some other way. Did you mean, "decode and print a message to the serial monitor from the..."?

Also you only mentioned one sequence, two blinks. Are there more that you're not telling us about?

Why are you ambivalent about the response, LED or serial message? Why does it not matter? Is this an academic exercise?

This is what i got so far. The first if statement is reading a blinking light from a board that is being flashed( the board blinks once while its being flashed and it blinks twice when it is done flashing). What i want to do is that when the board blinks twice it turns on another LED meaning that that board is finished flashing. What kind of code can I use to tell it "when you read a certain amount of blinks" (or in this case "LIGHT ON: ") to turn on another LED light?

Hello alr21
Post your sketch, well formated, with comments and in so called code tags "</>" to see how we can help.

Im doing project for my job, What im doing is flashing some board, while its flashing it blinks once and when its done flashing it blinks twice. When i look at the serial monitor, there are 2 different patterns that it shows me so what i need is when the photodiode reads the 2 blinks pattern to turn on an LED.

  1. Have you written any code yet?
  2. What is the exact timing of the LED blink?
  3. Have you made any hardware to do this?

You see how vague words can be? Does it really blink only once, or is it a series of single blinks? Again, what is the exact timing specification?

What is the origin of what is there? What did you send to the serial monitor?

I have written some code, i included a picture of it in my reply to paulpaulson
the timing on the LED blink for one blink is about 0.25 of a second
the hardware im using is an arduino uno, some LED lights, a breadboard, and one of the boards im flashing

it is a series of blinks, there is a series of single blinks and when the board is done flashing it becomes a series of double blinks, the timing for each blink is around .25 of a second

what im sending to the serial monitor is the data that the photodiode is collecting, when the light blinks i get a "LIGHT ON: and a number" and when the light is not blinking i get "LIGHT OFF: and a number"

Well, two consecutive single blinks is a double blink. So you have not given any specification that would differentiate between them.

Any blinks? Regardless of whether they are single or double? What is the number?

In this forum, you are expected to post it in text, inside code tags. Please do so now.

Also, No photodiode circuit?

There is a delay of about a seconds between each single blink. After about 2 minutes, its when the double blinks start

Still waiting for the code...

im not sure how to write it on here, its my first time on this forum. Do i just write it like i did on the arduino?