Arduino + 16 keypad Matrix 4×4 module and DO, RE, MI scale sounds

Libraries:
https://playground.arduino.cc/code/keypad

Arduino Code:

#include

int speakerPin = 12; // speaker connected to digital pin 12

const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns

char keys[ROWS][COLS] = {
{‘a’,’b’,’c’,’d’},
{‘e’,’f’,’g’,’h’},
{‘i’,’j’,’k’,’l’},
{‘m’,’n’,’o’,’p’}
};
byte rowPins[ROWS] = {2, 3, 4, 5}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {6, 7, 8, 9}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup(){

Serial.begin (9600);

pinMode(speakerPin, OUTPUT); // sets the speakerPin to be an output

}

void loop(){
char key = keypad.getKey();

if (key != NO_KEY){
Serial.println(key);

if (key==’a’){ beep(speakerPin,2093,100);}
if (key==’b’){ beep(speakerPin,2349,100);}
if (key==’c’){ beep(speakerPin,2637,100);}
if (key==’d’){ beep(speakerPin,2793,100);}
if (key==’e’){ beep(speakerPin,3136,100);}
if (key==’f’){ beep(speakerPin,3520,100);}
if (key==’g’){ beep(speakerPin,3951,100);}
if (key==’h’){ beep(speakerPin,4186,100);}
if (key==’i’){ beep(speakerPin,2093,100);}
if (key==’j’){ beep(speakerPin,2349,100);}
if (key==’k’){ beep(speakerPin,2637,100);}
if (key==’l’){ beep(speakerPin,2793,100);}
if (key==’m’){ beep(speakerPin,3136,100);}
if (key==’n’){ beep(speakerPin,3520,100);}
if (key==’o’){ beep(speakerPin,3951,100);}
if (key==’p’){ beep(speakerPin,4186,100);}
}
}

void beep (unsigned char speakerPin, int frequencyInHertz, long timeInMilliseconds){ // the sound producing function
int x;
long delayAmount = (long)(1000000/frequencyInHertz);
long loopTime = (long)((timeInMilliseconds*1000)/(delayAmount*2));
for (x=0;x<loopTime;x++)
{
digitalWrite(speakerPin,HIGH);
delayMicroseconds(delayAmount);
digitalWrite(speakerPin,LOW);
delayMicroseconds(delayAmount);
}
}

matrix_module_sound
Pin Map

Buy the materials:
ELEGOO Mega 2560 R3 Tarjeta Mega 2560 Arduino Compatible
https://amzn.to/2Tzak6S

SHAHIDEER 4 x 4 keypad matrix module
https://amzn.to/2Cgc9ea

Piezo electric disk transducer 35mm (5x)
https://amzn.to/2HrVs2U

ADS

Arduino Mega Compatible
en Amazon
por menos de 15€

Arduino Mega Compatible
en Amazon
por menos de 14€

Arduino Mega Kit
en Amazon
por menos de 30€

Arduino Mega Kit
en Amazon
por menos de 60€

ADS

Impresora 3D en Amazon
por menos de 150€

Filamento ABS en Amazon
por menos de 20€

Filamento PLA en Amazon
por menos de 20€

Filamento PLA en Amazon
por menos de 20€

Ultraviolet 3D printing

 

Imprimiendo con filamento que brilla en la oscuridad unas calaveras
a ritmo de la música.

Además he sustituido algunas partes de mi impresora por filamento que reacciona con la luz UV.
queda guapa o no?

//CASTELLANO

Comprar filamento PLA que brilla en la oscuridad a 20€ KG:
https://amzn.to/2CgQ2Ew

¿Todavía no tienes tu impresora 3D? ahora por menos de 200€ puedes tener una y amazon te la lleva a casa, mas información en el siguiente link:
https://amzn.to/2HfiCKl

¿Necesitas filamento de buena calidad? compralo por menos de 20€ el KG
FILAMENTO PLA Impresora 3D Impresion Bobina 1,75MM 1KG Blanco Perla
https://amzn.to/2HjkG4n

También os dejo el link de un manual de Sketchup Pro a la venta en Amazon:
Sketchup Pro – Manual Basico: Manual Practico De Aprendizaje Y Referencia
https://amzn.to/2F3b6jB
//ENGLISH

Testing Ultraviolet Lights over a sort of filaments to get the ones that reacts glowing under this light.

Buy Glow in Dark filament:
https://amzn.to/2CgQ2Ew

Do not have your 3D printer yet? now for less than € 200 you can have one and amazon takes it home, more information in the following link:
https://amzn.to/2HfiCKl

Do you need good quality filament? buy it for less than € 20 the KG
FILAMENTO PLA 3D Printer Impresion Coil 1,75MM 1KG White Pearl
https://amzn.to/2HjkG4n

I also leave the link to a Sketchup Pro manual for sale on Amazon:
Sketchup Pro – Manual Basico: Practical Manual Of Learning And Reference
https://amzn.to/2F3b6jB

ADS

Impresora 3D en Amazon
por menos de 150€

Filamento ABS en Amazon
por menos de 20€

 

Filamento PLA en Amazon
por menos de 20€

Filamento PLA en Amazon
por menos de 20€