Differences

This shows you the differences between two versions of the page.

Link to this comparison view

pm:prj2024:ddosaru:marius.cristea1811 [2024/05/27 02:09]
marius.cristea1811 [Software Design]
pm:prj2024:ddosaru:marius.cristea1811 [2024/05/27 02:10] (current)
marius.cristea1811 [Software Design]
Line 88: Line 88:
 </​note>​ </​note>​
  
 +Codul pentru joc: \\
 <file PM_project>​ <file PM_project>​
  
Line 423: Line 424:
   tft.print(text);​   tft.print(text);​
 } }
 +
 +</​file>​
 +
 +Codul pentru muzica: \\
 +<file music>
 +#include <​SPI.h>​
 +#include <​SD.h>​
 +#include <​TMRpcm.h>​
 +
 +#define CS_SD 4
 +#define Speaker 9
 +TMRpcm audio;
 +
 +void setup() {
 +  Serial.begin(9600);​
 +
 +  if(!SD.begin(CS_SD)) {
 +    Serial.println("​A esuat initializarea cardului SD");
 +    while(1);
 +  }
 +
 +  audio.CSPin = CS_SD;
 +  audio.speakerPin = Speaker;
 +  audio.setVolume(6);​
 +
 +}
 +
 +void loop() {  ​
 +  if (!audio.isPlaying()) {
 +    audio.play("​powerup.wav"​);​
 +  }
 +}
 +
 +
 +
 +
  
 </​file>​ </​file>​
pm/prj2024/ddosaru/marius.cristea1811.1716764968.txt.gz · Last modified: 2024/05/27 02:09 by marius.cristea1811
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0