// RandomSeed.ino https://wokwi.com/projects/358276294916324353
// for https://forum.arduino.cc/t/toggle-switch-puzzle-but-sequential/1091460/47
const int seedtype = 4;
void setup() {
Serial.begin(115200);
switch (seedtype) {
case 1:
randomSeed(20230304) ; //
case 2:
pinMode(12, INPUT_PULLUP);
Serial.println("Ground pin 12 for a random number");
while (digitalRead(12)) random(RANDOM_MAX);
break;
case 3:
randomSeed(random(RANDOM_MAX) + micros() + analogRead(A0));
break;
case 4:
randomSeed(analogRead(A0)); // 10 bits if you're lucky
break;
case 5:
randomSeed(1+analogRead(A0) % 4); // maybe two bits of randomness
break;
case 0:
break;
default:
Serial.println("bad seed scheme");
;
}
Serial.println(random(RANDOM_MAX));
for (int i = 6; i; --i)
Serial.println(random(6));
}
void loop() {
}