This shows you the differences between two versions of the page.
pm:prj2023:avaduva:random [2023/05/30 02:17] teodor.ionascu1507 [Software Design] |
pm:prj2023:avaduva:random [2023/05/30 02:33] (current) teodor.ionascu1507 [Software Design] |
||
---|---|---|---|
Line 23: | Line 23: | ||
====Physical Project==== | ====Physical Project==== | ||
- | {{ :pm:prj2023:avaduva:pozaproiect1_ciucu_ovidiu.jpeg?nolink&300 |}} | + | {{:pm:prj2023:avaduva:ionascu1_2023-05-30_at_01.54.28.jpeg?200|}} |
- | {{ :pm:prj2023:avaduva:pozaproiect2_ciucu_ovidiu.jpeg?nolink&300 |}} | + | {{:pm:prj2023:avaduva:ionascu2_2023-05-30_at_01.54.06.jpeg?200|}} |
- | {{ :pm:prj2023:avaduva:pozaproiect3_ciucu_ovidiu.jpeg?nolink&300 |}} | + | {{:pm:prj2023:avaduva:ionascu3_2023-05-30_at_01.53.48.jpeg?200|}} |
===== Software Design ===== | ===== Software Design ===== | ||
== Libraries used == | == Libraries used == | ||
Line 33: | Line 32: | ||
== Funcții implementate: == | == Funcții implementate: == | ||
- | *setup(): This function is called once at the beginning of the program and is responsible for initializing the pins and sensors. | + | ***setup():** This function is called once at the beginning of the program and is responsible for initializing the pins and sensors. |
- | + | ***generateRandomNumber():** This function reads the temperature from the sensor and generates a random number based on the temperature value. It combines the temperature reading with the traditional random number generation to add an element of unpredictability. | |
- | *generateRandomNumber(): This function reads the temperature from the sensor and generates a random number based on the temperature value. It combines the temperature reading with the traditional random number generation to add an element of unpredictability. | + | ***playSlotSound():** This function plays a slot machine-like sound effect using the buzzer. It utilizes predefined arrays of notes and durations to create the desired sound. |
- | + | ***flickerLEDs():** This function controls the LEDs connected to the dice pins and makes them flicker rapidly, creating an animated effect during the dice roll. | |
- | *playSlotSound(): This function plays a slot machine-like sound effect using the buzzer. It utilizes predefined arrays of notes and durations to create the desired sound. | + | ***loop():** This function is the main execution loop of the program. It continuously checks if the button is pressed and performs the dice roll sequence, including playing the sound, flickering the LEDs, generating the random number, and displaying it on the dice LEDs. |
- | + | ||
- | *flickerLEDs(): This function controls the LEDs connected to the dice pins and makes them flicker rapidly, creating an animated effect during the dice roll. | + | |
- | + | ||
- | *loop(): This function is the main execution loop of the program. It continuously checks if the button is pressed and performs the dice roll sequence, including playing the sound, flickering the LEDs, generating the random number, and displaying it on the dice LEDs. | + | |
==Code for the project== | ==Code for the project== | ||
- | {{:pm:prj2023:avaduva:etilotest.rar|}} | + | {{:pm:prj2023:avaduva:trngdice.rar|}} |
====Conclusions=== | ====Conclusions=== | ||
- | It has been a fun experience learning how to create an Alcohol tester. I believe that this device can be later used if needed. My knowledge regarding the Arduino technology has definitely improved. | + | It has been a fun experience learning how to create a True Random Generating Dice game. I believe that this device can be later used if needed. My knowledge regarding the Arduino technology has definitely improved. |
===== Journal ===== | ===== Journal ===== | ||
01.05.2023 - Initial Documentation | 01.05.2023 - Initial Documentation | ||
- | 03.05.2023 - Ordered the needed parts | + | 10.05.2023 - Ordered the needed parts |
- | 10.05.2023 - Started testing the sensor | + | 15.05.2023 - Started testing the parts |
- | 28.05.2023 - Finished the project | + | 30.05.2023 - Finished the project |
===== Resources ===== | ===== Resources ===== | ||
- | * Hardware diagram [[https://www.circuito.io/]] | ||
* Arduino IDE [[https://www.arduino.cc/en/software]] | * Arduino IDE [[https://www.arduino.cc/en/software]] | ||
- | * Site for components: [[https://www.sigmanortec.ro/]] | + | * Site for components: [[https://www.optimusdigital.ro/ro/]] |
<html><a class="media mediafile mf_pdf" href="?do=export_pdf">Export to PDF</a></html> | <html><a class="media mediafile mf_pdf" href="?do=export_pdf">Export to PDF</a></html> |