Programming Arduino Dice Roller: Making random() more Random [3/3]

preview_player
Показать описание
In this Arduino live-coding series you will learn how to program your own dice roller project! We'll write the code together, from scratch, solving interesting challenges, and I will explain every step and show you how to create clean, readable Arduino code.

Video timeline:
00:00 Review
00:26 Adding randomness using random()
01:18 Debugging why random() isn't so random?!
02:05 Combining randomSeed() with analogRead()
04:03 Adding the push button to the code
05:52 Using the user input as source of randomness
06:15 2nd approach: combining randomSeed() with micros()
07:58 Adding the final touches
09:16 Uploading the code to the Arduino and enjoying the final result!

The complete code from this video:

Рекомендации по теме
Комментарии
Автор

I'm getting the same sequences even when using the analogue pin for randomseed. The micros() worked much better. Thanks!

ArcanePath
Автор

good video i make a digital dice in past using Arduino and i use srand and serial value in seed that even randomise the numbers.

mtalhakhalid
Автор

You could use a analog white noise generator, a npn transistor noise circuit plus 2 opamps for scaling (from an analog synthesizer module, like eurorack) tied to analog pin.

AnalogDude_
Автор

Thank you for doing this, I'm really learning a lot from your videos! I do have one question. Why did you use Micros() instead of Millis() ? Is there an advantage?

peterthinks
Автор

can u make one with 2 leds and like a yes or no dice thingy

HashirEasa
join shbcf.ru