Projeto Hit The LightIntegrantes:Augusto Cesar Pupo VieiraCassia de Souza CorreaDenilson Gianeiz JuniorFilipe Ricardo Reis SbragioMateriais:Ceramica para a criacao das teclasLED's coloridosArduinoCaixa de somPC para execucao do programaProjeto: A primeira parte do projeto consistiu em criar o teclado com 7 teclas. Abaixo de cada tecla ha um LED com cores diferentes e sempre que uma tecla e tocada o LED correspondente acende.Programamos uma interface Java com teclas para o usuario poder criar uma musica no computador. Essas teclas sao entao passadas ao Arduino, assim o som e os LED's correspondentes irao tocar, com isso o usuario podera aprender a tocar qualquer musica no nosso piano. import java.util.*; public class Teclado extends javax.swing.JFrame{ int teclas[] = new int[99999]; double tempoPressionado[] = new double[99999]; int qtdElementos=0; String filetxt = "notas.txt"; long tempoSemTocarInicial=0, tempoSemTocarFinal, tempoSemTocarTotal; long tempoApertadoDo, tempoSoltoDo, tempoTotalDo; long tempoApertadoRe, tempoSoltoRe, tempoTotalRe; long tempoApertadoMi, tempoSoltoMi, tempoTotalMi; long tempoApertadoFa, tempoSoltoFa, tempoTotalFa; long tempoApertadoSol, tempoSoltoSol, tempoTotalSol; long tempoApertadoLa, tempoSoltoLa, tempoTotalLa; long tempoApertadoSi, tempoSoltoSi, tempoTotalSi; String texto[] = new String[999]; File_IO readWrite = new File_IO(); Scanner keyboard = new Scanner(System.in); public Teclado() { initComponents(); } @SuppressWarnings("unchecked") private void initComponents() { jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jButton4 = new javax.swing.JButton(); jButton5 = new javax.swing.JButton(); jButton6 = new javax.swing.JButton(); jButton7 = new javax.swing.JButton(); jButton8 = new javax.swing.JButton(); jButton10 = new javax.swing.JButton(); jButton11 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jButton1.setBackground(new java.awt.Color(255, 255, 255)); jButton1.setText("Do"); jButton1.setMaximumSize(new java.awt.Dimension(73, 23)); jButton1.setMinimumSize(new java.awt.Dimension(73, 23)); jButton1.setPreferredSize(new java.awt.Dimension(73, 23)); jButton1.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { jButton1MousePressed(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { jButton1MouseReleased(evt); } }); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setBackground(new java.awt.Color(255, 255, 255)); jButton2.setText("Re"); jButton2.setMaximumSize(new java.awt.Dimension(73, 23)); jButton2.setMinimumSize(new java.awt.Dimension(73, 23)); jButton2.setPreferredSize(new java.awt.Dimension(73, 23)); jButton2.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { jButton2MousePressed(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { jButton2MouseReleased(evt); } }); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jButton3.setBackground(new java.awt.Color(255, 255, 255)); jButton3.setText("Mi"); jButton3.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { jButton3MousePressed(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { jButton3MouseReleased(evt); } }); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); jButton4.setBackground(new java.awt.Color(255, 255, 255)); jButton4.setText("Fa"); jButton4.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { jButton4MousePressed(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { jButton4MouseReleased(evt); } }); jButton5.setBackground(new java.awt.Color(255, 255, 255)); jButton5.setText("Sol"); jButton5.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { jButton5MousePressed(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { jButton5MouseReleased(evt); } }); jButton6.setBackground(new java.awt.Color(255, 255, 255)); jButton6.setText("La"); jButton6.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { jButton6MousePressed(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { jButton6MouseReleased(evt); } }); jButton7.setBackground(new java.awt.Color(255, 255, 255)); jButton7.setText("Si"); jButton7.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { jButton7MousePressed(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { jButton7MouseReleased(evt); } }); jButton7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton7ActionPerformed(evt); } }); jButton8.setText("End"); jButton8.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton8ActionPerformed(evt); } }); jButton10.setText("Stop"); jButton10.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton10ActionPerformed(evt); } }); jButton11.setText("Start"); jButton11.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton11ActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jButton11) .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)