Differences

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

Link to this comparison view

pm:prj2024:vstoica:adelin_costin.popa [2024/05/05 23:21]
adelin_costin.popa [Nume proiect]
pm:prj2024:vstoica:adelin_costin.popa [2024/05/23 23:43] (current)
adelin_costin.popa [Software Design]
Line 9: Line 9:
 ===== Descriere generală ===== ===== Descriere generală =====
  
-<note tip> +{{ :​pm:​prj2024:​vstoica:​tuneduino.png?nolink | }} 
-O schemă bloc cu toate modulele proiectului vostru, atât software cât şi hardware însoţită de o descriere a acestora precum şi a modului în care interacţionează.+===== Hardware Design =====
  
-Exemplu de schemă bloc: http://​www.robs-projects.com/​mp3proj/​newplayer.html +  * 1 x Arduino Uno 
-</​note>​+  * 4 x butoane 
 +  * 1 x modul pentru SD card 
 +  * 1 x SD card 
 +  * 1 x breadboard 
 +  * 1 x speaker
  
-===== Hardware Design ===== 
  
-<note tip> +=== Schema electrica === 
-Aici puneţi tot ce ţine de hardware design: +{{ :pm:prj2024:​vstoica:​tuneduino-electrical-scheme.jpg?​nolink&​600 | }}
-  * listă de piese +
-  * scheme electrice (se pot lua şi de pe Internet şi din datasheet-uri,​ e.g. http://​www.captain.at/​electronic-atmega16-mmc-schematic.png) +
-  * diagrame de semnal  +
-  * rezultatele simulării +
-</​note>​+
  
 +=== Montaj ===
 +{{ :​pm:​prj2024:​vstoica:​tuneduino-poc.jpg?​nolink&​400 | }}
 ===== Software Design ===== ===== Software Design =====
  
  
-<note tip> +  * Arduino IDE 
-Descrierea codului aplicaţiei ​(firmware): +  * DFRobotDFPlayerMini ​(pentru player-ul de muzica), SevSeg (pentru operarea cu display-ul pe 7 segmente) 
-  ​* mediu de dezvoltare ​(if any) (e.gAVR StudioCodeVisionAVR+ 
-  * librării şi surse 3rd-party (e.gProcyon AVRlib+ 
-  ​* algoritmi şi structuri pe care plănuiţi să le implementaţi +  ​void loop(
-  ​(etapa 3surse şi funcţii implementate +  { 
-</note>+  unsigned long currentMillis = millis(); 
 +  unsigned long duration; 
 +  ​if (in_menu
 +    buttonState = digitalRead(mainbutton);​ 
 + 
 +    if (buttonState != lastButtonState) { // button state changed 
 +      updateState();​ 
 +    } 
 + 
 +    if (startPressed == -1 && endPressed == -1) { 
 +      if (longPress) { 
 +        in_menu = false; 
 +        playing = true; 
 +        myDFPlayer.play(song_number); ​ // Play song 
 +        if (myDFPlayer.available()) { 
 +          printDetail(myDFPlayer.readType()myDFPlayer.read()); //Print the detail message from DFPlayer to handle different errors and states. 
 +        } 
 +      } else { 
 +        if (currentMillis ​previousMillis >= interval) { 
 +          previousMillis = currentMillis;​ 
 +          song_number++;​ 
 +          if (song_number > 9) { 
 +            song_number = 1; 
 +          } 
 +        } 
 + 
 +        sevseg.setNumber(song_number);​ 
 +      } 
 +      startPressed = 0; 
 +      endPressed = 0; 
 +    } 
 + 
 +    lastButtonState = buttonState;​ 
 +  } else if (playing) { 
 +    sevseg.blank(); 
 +    if (currentMillis - previousMillis >= interval) { 
 +        previousMillis = currentMillis;​ 
 +        safety_check = true; 
 +    } 
 + 
 +    if (digitalRead(mainbutton) == LOW && safety_check) { 
 +        playing = false; 
 +        myDFPlayer.stop(); ​ // Stop playing 
 +        safety_check = false; 
 +    } 
 +  ​} else if (!playing && !in_menu{ 
 +    ​sevseg.setChars("​P"​);​ 
 + 
 +    if (currentMillis - previousMillis ​>= interval) { 
 +      previousMillis = currentMillis;​ 
 +      safety_check = true; 
 +    } 
 + 
 +    if (digitalRead(mainbutton) == LOW && safety_check) { 
 +        playing = true; 
 +        // myDFPlayer.play(song_number); ​ // Resume playing 
 +        myDFPlayer.next();​ 
 +        if (myDFPlayer.available()) { 
 +          printDetail(myDFPlayer.readType(),​ myDFPlayer.read());​ //Print the detail message from DFPlayer to handle different errors and states. 
 +        } 
 +        sevseg.blank();​ 
 +        safety_check = false; 
 +      } 
 +  } 
 + 
 +  sevseg.refreshDisplay();​ 
 +  }
  
 ===== Rezultate Obţinute ===== ===== Rezultate Obţinute =====
pm/prj2024/vstoica/adelin_costin.popa.1714940482.txt.gz · Last modified: 2024/05/05 23:21 by adelin_costin.popa
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