The code linked in Pulse a relay at a random time - #3 by Idahowalker is a about doing several things at once is a good way to handle the separate timed relay versus the others. I just need a way to get a separate relay to give me a 1 sec pulse within a given time range. For minutes you have to multiply your random () result ( 1000 60, assuming delay () takes milli-sec). The first set of relays use the delay parameter which will delay the entire sequence so another user has suggested using millis along side (or instead of?) delay. Just check if delay () uses parameter in milli-seconds, for sure not minutes. Look at File|Examples|02.Digital|BlinkWithoutDelay to use millis() for timing instead of delay(). Please describe the problem better then you just did. Paraphrasing the error message leaves out important information. ![]() Copy the error and paste into a post in code tags. There is a button (lower right of the IDE window) called "copy error message". ![]() analogRead () auf einem nicht verbundenen Pin. Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags. Wenn es fr eine von random () erzeugte Folge von Werten wichtig ist, dass diese bei nachfolgenden Ausfhrungen eines Sketches unterschiedlich ist, verwende randomSeed (), um den Zufallszahlengenerator mit einer ziemlich zuflligen Eingabe zu initialisieren, z. This tutorial is a simple sketch and circuit to show how this is done. Use code tags (the icon above the compose window) to make it easier to read and copy code for examination That is easy, but what if you want to have something else going on during the delay The answer use millis (). ![]() Please follow the advice given in this link How to get the best out of this forum when posting code, in particular the section entitled 'Posting code and common code problems'.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |