Customizable Random Number Generator

by Aced Inventor in Circuits > Arduino

1856 Views, 10 Favorites, 0 Comments

Customizable Random Number Generator

Customizable Random Number Generator | Arduino

In this project, we will be building a "Customizable Random Number Generator," in which you can set the minimum and maximum values. We will be using two buttons to toggle the settings on the OLED display. For example, if the minimum value is 0 and our maximum value is 6 the random number generator will generate a number between those values such as 5.

This project can still be improved.

Supplies

Wiring.png

The components needed to make the project are:

OLED Wiring

OLEDWiring.jpg

Connect the OLED as following:

Arduino >> OLED

GND >> GND

5V >> VCC

SDA >> A4

SCL >> A5

Button Wiring

ButtonWiring.jpg

Connect the Buttons as following:

Arduino >> Button

D2 >> Toggle Button

D3 >> Selecting Button

Uploading the Program

Arduino IDE.png

Open the program on Arduino IDE. Once it is open, compile the sketch to see if it is clear of error and upload it. Make sure you have all the libraries download before you upload the program. After uploading the program, the OLED screen should turn on and display "Aced Inventor." Then the settings screen will come on which you can set your minimum and maximum values for the random number generator to generate from. You will also have to download the .zip OLED_I2c library.

For more information about this, please visit my Patreon:
https://www.patreon.com/acedinventor

Testing the Project

Thunbnail Image.png

To test if the project is working properly, plug the Arduino Nano into a power source. The OLED screen should turn on and say "Aced Inventor." After that, the setting screen should come on which you can set your minimum and maximum values. Then you can press next. Every time you press the button a new number will be generated. Because the random numbers generated are random they sometimes might be the same. But they are random.

If there is still something you don't understand, you can comment down below.