This shows you the differences between two versions of the page.
pm:prj2022:cstan:crystal_ball [2022/05/27 23:41] adriana.costan |
pm:prj2022:cstan:crystal_ball [2022/05/27 23:50] (current) adriana.costan |
||
---|---|---|---|
Line 43: | Line 43: | ||
In CrystalBall.ino: | In CrystalBall.ino: | ||
- | Firstly, I have initialized the pins for the tilt sensor, piezo and speaker. | + | Firstly, I have initialized the pins for the tilt sensor, piezo. |
In setup() I have displayed the initial message on the LCD: "Ask the Crystal Ball!" | In setup() I have displayed the initial message on the LCD: "Ask the Crystal Ball!" | ||
In loop() I initialized the sequence of the LEDs flickering in order to play constantly during the functioning of the toy and using a switch-case algorithm the toy would generate 1 out of 8 possible answers. | In loop() I initialized the sequence of the LEDs flickering in order to play constantly during the functioning of the toy and using a switch-case algorithm the toy would generate 1 out of 8 possible answers. | ||
Line 49: | Line 49: | ||
In Music.ino: | In Music.ino: | ||
- | In Setup() I have defined the notes for the background song, the melody and the notes duration and initialized the pin for the speaker. | + | First I have defined the notes for the background song, the melody and the notes duration and initialized the pin for the speaker. |
- | In loop() I have the for with which i play on repeat the background music. | + | In loop() I have the for with which I play on repeat the background music. |
===== Obtained results ===== | ===== Obtained results ===== | ||
Line 68: | Line 68: | ||
===== Download ===== | ===== Download ===== | ||
- | {{:pm:prj2022:cstan:crystalball.7z|}} | + | The code: {{:pm:prj2022:cstan:crystalball.7z|}} |
+ | The PDF version of the project: {{:pm:prj2022:cstan:crystal_ball.pdf|}} | ||
===== Bibliography/Resources ===== | ===== Bibliography/Resources ===== | ||
Link for Project Crystal Ball: [[https://ocw.cs.pub.ro/courses/pm/prj2022/cstan/crystal_ball]] | Link for Project Crystal Ball: [[https://ocw.cs.pub.ro/courses/pm/prj2022/cstan/crystal_ball]] |