Advertisement
claudiusmarius

VoxDisplay

Feb 26th, 2024
554
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.10 KB | None | 0 0
  1. #include <TM1637Display.h>
  2.   #include <Adafruit_NeoPixel.h>
  3.   #include <Arduino.h>
  4.   #define CLK1 10
  5.   #define DIO1 9
  6.  
  7.   #include <DFRobot_DF1201S.h>
  8.   #include <SoftwareSerial.h>
  9.   SoftwareSerial DF1201SSerial(2, 3);  //RXarduino  TXarduino ATTENTION RX TX inversés sur DFPlayer PRO
  10.   DFRobot_DF1201S DF1201S;
  11.  
  12.   TM1637Display display1(CLK1, DIO1);
  13.  
  14.   void setup(void)
  15.   {
  16.   Serial.begin(115200);
  17.   DF1201SSerial.begin(115200);
  18.   while(!DF1201S.begin(DF1201SSerial))
  19.   {
  20.   delay(100);
  21.   }
  22.   DF1201S.setVol(20);                         // Echelle  0 - 30
  23.  
  24.   DF1201S.switchFunction(DF1201S.MUSIC);
  25.   delay(3000);
  26.    display1.setBrightness(0x0A);
  27.   }
  28.  
  29.   void loop()
  30. {
  31.   DF1201S.start();
  32.   delay(50);
  33.   display1.showNumberDec(100, false, 4, 0);
  34.   DF1201S.playSpecFile("/wife/001F.mp3");                        
  35.   delay(3000);
  36.   DF1201S.pause();
  37.  
  38.   DF1201S.start();
  39.   delay(50);
  40.  
  41.   display1.showNumberDec(200, false, 4, 0);
  42.   DF1201S.playSpecFile("/men/002H.mp3");                        
  43.   delay(3000);
  44.   DF1201S.pause();
  45.  
  46.   DF1201S.start();
  47.   delay(50);
  48.  
  49.   display1.showNumberDec(300, false, 4, 0);
  50.   DF1201S.playSpecFile("/wife/003F.mp3");                        
  51.   delay(3000);
  52.   DF1201S.pause();
  53.  
  54.   DF1201S.start();
  55.   delay(50);
  56.  
  57.   display1.showNumberDec(400, false, 4, 0);
  58.   DF1201S.playSpecFile("/men/004H.mp3");                        
  59.   delay(2000);
  60.   DF1201S.pause();
  61.  
  62.   DF1201S.start();
  63.   delay(50);
  64.  
  65.   display1.showNumberDec(500, false, 4, 0);
  66.   DF1201S.playSpecFile("/wife/005F.mp3");                        
  67.   delay(3000);
  68.   DF1201S.pause();
  69.  
  70.   DF1201S.start();
  71.   delay(50);
  72.  
  73.  
  74.   display1.showNumberDec(600, false, 4, 0);
  75.   DF1201S.playSpecFile("/men/006H.mp3");                        
  76.   delay(3000);
  77.   DF1201S.pause();
  78.  
  79.   DF1201S.start();
  80.   delay(50);
  81.  
  82.   display1.showNumberDec(700, false, 4, 0);
  83.   DF1201S.playSpecFile("/wife/007F.mp3");                        
  84.   delay(3000);
  85.   DF1201S.pause();
  86.  
  87.   DF1201S.start();
  88.   delay(50);
  89.  
  90.   display1.showNumberDec(800, false, 4, 0);
  91.   DF1201S.playSpecFile("/men/008H.mp3");                        
  92.   delay(3000);
  93.   DF1201S.pause();
  94.  
  95.   DF1201S.start();
  96.   delay(50);
  97.  
  98.   display1.showNumberDec(900, false, 4, 0);
  99.   DF1201S.playSpecFile("/wife/009F.mp3");                        
  100.   delay(3000);
  101.   DF1201S.pause();
  102.  
  103.   DF1201S.start();
  104.   delay(50);
  105.  
  106.   display1.showNumberDec(1000, false, 4, 0);
  107.   DF1201S.playSpecFile("/men/010H.mp3");                  
  108.   delay(3000);
  109.   DF1201S.pause();
  110.  
  111.   DF1201S.start();
  112.   delay(50);
  113.  
  114.   display1.showNumberDec(1100, false, 4, 0);
  115.   DF1201S.playSpecFile("/wife/010F.mp3");                        
  116.   delay(3000);
  117.   DF1201S.pause();
  118.  
  119.   DF1201S.start();
  120.   delay(50);
  121.  
  122.   display1.showNumberDec(1200, false, 4, 0);
  123.   DF1201S.playSpecFile("/men/012H.mp3");                        
  124.   delay(3000);
  125.   DF1201S.pause();
  126.  
  127.   DF1201S.start();
  128.   delay(50);
  129.  
  130.   display1.showNumberDec(1300, false, 4, 0);
  131.   DF1201S.playSpecFile("/wife/013F.mp3");                        
  132.   delay(3000);
  133.   DF1201S.pause();
  134.  
  135.   DF1201S.start();
  136.   delay(50);
  137.  
  138.   display1.showNumberDec(1400, false, 4, 0);
  139.   DF1201S.playSpecFile("/men/014H.mp3");                  
  140.   delay(3000);
  141.   DF1201S.pause();
  142.  
  143.   DF1201S.start();
  144.   delay(50);
  145.  
  146.   display1.showNumberDec(1500, false, 4, 0);
  147.   DF1201S.playSpecFile("/wife/015F.mp3");                        
  148.   delay(3000);
  149.   DF1201S.pause();
  150.  
  151.   DF1201S.start();
  152.   delay(50);
  153.  
  154.   display1.showNumberDec(1600, false, 4, 0);
  155.   DF1201S.playSpecFile("/men/016H.mp3");                        
  156.   delay(3000);
  157.   DF1201S.pause();
  158.  
  159.   DF1201S.start();
  160.   delay(50);
  161.  
  162.   display1.showNumberDec(1700, false, 4, 0);
  163.   DF1201S.playSpecFile("/wife/017F.mp3");                  
  164.   delay(3000);
  165.   DF1201S.pause();
  166.  
  167.  
  168.   DF1201S.start();
  169.   delay(50);
  170.  
  171.   display1.showNumberDec(1800, false, 4, 0);
  172.   DF1201S.playSpecFile("/men/018H.mp3");                        
  173.   delay(3000);
  174.   DF1201S.pause();
  175.  
  176.   DF1201S.start();
  177.   delay(50);
  178.  
  179.   display1.showNumberDec(1900, false, 4, 0);
  180.   DF1201S.playSpecFile("/wife/019F.mp3");                  
  181.   delay(3000);
  182.   DF1201S.pause();
  183.  
  184.   DF1201S.start();
  185.   delay(50);
  186.  
  187.   display1.showNumberDec(2000, false, 4, 0);
  188.   DF1201S.playSpecFile("/men/020H.mp3");                        
  189.   delay(3000);
  190.   DF1201S.pause();
  191.  
  192.   DF1201S.start();
  193.   delay(50);
  194.  
  195.   display1.showNumberDec(2100, false, 4, 0);
  196.   DF1201S.playSpecFile("/wife/021F.mp3");                        
  197.   delay(3000);
  198.   DF1201S.pause();
  199.  
  200.   DF1201S.start();
  201.   delay(50);
  202.  
  203.   display1.showNumberDec(2200, false, 4, 0);
  204.   DF1201S.playSpecFile("/men/022H.mp3");                  
  205.   delay(3000);
  206.   DF1201S.pause();
  207.  
  208.  
  209.   DF1201S.start();
  210.   delay(50);
  211.  
  212.   display1.showNumberDec(2300, false, 4, 0);
  213.   DF1201S.playSpecFile("/wife/023F.mp3");                        
  214.   delay(3000);
  215.   DF1201S.pause();
  216.  
  217.   DF1201S.start();
  218.   delay(50);
  219.  
  220.   display1.showNumberDec(2400, false, 4, 0);
  221.   DF1201S.playSpecFile("/men/024H.mp3");                  
  222.   delay(3000);
  223.   DF1201S.pause();
  224. }
  225.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement