Go Down

Topic: Using an Arduino to process white noise into Random Numbers (Read 11599 times) previous topic - next topic


Code: [Select]
uint32_t getRandomUL()
  uint32_t x = 0;
  for (uint8_t i = 0; i < 32; i++)
    x |= ((analogRead(A0) & 0x01) << i);

is never going to return random(*) values, just junk off the stack.

Perhaps you meant to "return x;" ?

(*) OK, junk off the stack can look random, but we want somewhat more random than that here!
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up