Can the Due present a timed response to an event?

I have a pending application in which a Due is setup to count to a preset number, and when it reaches that number it promptly causes Digital D2 to go high and thus activate something. And it might not be the Due in the final design idea, I'm also looking at one of the Feathers from Adafruit. (Going to ask them roughly the same question next time.)

At least that's as far as my thought experiment took things.
For example in the BASIC world I could code it to do that easily. But I'm very rusty writing things in sketches for the Arduino Due and its related systems.

Any Arduino board can do this. Just start working your way through the tutorials and you'll learn how to do it very soon:

You can consult the Arduino Language Reference if you find any code in the tutorials that doesn't makes sense:

Any one of thousands of microprocessor systems can do that. What is it counting?



Any one of thousands of microprocessor systems can do that. What is it counting?

Well if it were to be built today and running, it would be simply counting seconds.

The Arduino has a continuously running timer that counts in milliseconds. You can get the current value of the timer with the millis() function. 4 hours is 4x60x60x1000 milliseconds.

Then you know some basic programming. Time to learn another programming language. It gets easier every time.

The language is called C/C++. It is likely the most supported programming language in the world (books, youtube videos, university lectures, online references ...).

As in0 suggested work trough the build-in examples and watch a youtube video or two on C programming basics.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.