Help writing code for the flowchart I created.

Hello fellow Enthusiasts!

I created a flowchart for a program I would like to wright for the Uno. I would like to use the toggling digital output from an IR object detector to detect the presence of on object When an object is detected light LED1, if object is still being detected after 5 seconds, light an blink LED2, if the object is still detected after 10 seconds light LED3, turn all LEDs off and return to start.

This is far beyond my programming ability. Any thoughts on how to create this code would be awesome!!

Thanks in advance!

This is far beyond my programming ability.

So start with something simpler or just part of your project.

Learn to read a digital input
Learn to turn an LED on and off
Learn to use millis() for timing

Examples of each are in the IDE

Yes, break it down into smaller pieces.

Running a simple tutorial like Blink (referred to above by UKHeliBob) confirms that you can accurately compile a sketch, upload to a board and see direct output.

The you can modify it to make it blink differently. Blink faster. Blink slower. Confirm that you can make a code change and see that change the behavior of the board.

Hi Thanks for the replies!

I can do all of the things mentioned above but I have trouble putting these all together to getting the syntax correct to make it work. I always get compile errors and debugging my code is a very difficult task with the tools available I found.

@Mully911 will be enjoying a brief forum timeout to allow @Mully911 time to read the forum guidelines on cross-posting.