Permalink
Browse files

configurable random seed with its setter

  • Loading branch information...
gioblu committed Nov 28, 2016
1 parent 3520af3 commit 27ac42744f860b857388f7e2c2cc0f2195a74b46
Showing with 8 additions and 1 deletion.
  1. +8 −1 PJON.h
9 PJON.h
@@ -123,7 +123,7 @@ limitations under the License. */
/* Begin function to be called in setup: */
void begin() {
randomSeed(analogRead(A0));
randomSeed(analogRead(_random_seed));
delay(random(0, INITIAL_DELAY));
};
@@ -702,6 +702,13 @@ limitations under the License. */
};
/* Set the pin used as a seed for random generator: */
void set_random_seed(uint8_t random_seed) {
_random_seed = random_seed;
};
/* Pass as a parameter a void function you previously defined in your code.
This will be called when a correct message will be received.
Inside there you can code how to react when data is received.

0 comments on commit 27ac427

Please sign in to comment.