Go Down

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

MarkT

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 won't respond to messages, use the forum please ]

Go Up