Project in progress
Keyboard V2.0

Keyboard V2.0 © GPL3+

An update of the older version of the keyboard. Now it doesn't require switches on your breadboard, you can use your pc keyboard.

  • 8,217 views
  • 19 comments
  • 16 respects

Components and supplies

Apps and online services

About this project

That's an update for the older version of the project!

Now you can play the keyboard on the keys from A to J and from Q to U for # notes.

It's set on the fifth scale, but you can set it as you like by editing the code.

I recommend you not to use the Arduino Serial Monitor to play this project, because you would have to hit the "Enter" key after every note to play it.

So, you should download PuTTY from here and set the connection type as "Serial" in the first window that appear, insert your COM in the serial line (you can verify where Arduino is connected in Windows Device Manager) and then click on "Open".

A terminal windows should appear with the message set in the code.

Now you're free to play it! Hope you have fun :)

Code

Code for Arduino Keyboard 2.0C/C++
That's the code for your Arduino Keyboard 2.0
#include "pitches.h"

int C[] = {N_C5};
int CS[] = {N_CS5};
int D[] = {N_D5};
int DS[] = {N_DS5};
int E[] = {N_E5};
int F[] = {N_F5};
int FS[] = {N_FS5};
int G[] = {N_G5};
int GS[] = {N_GS5};
int A[] = {N_A5};
int AS[] = {N_AS5};
int B[] = {N_B5};
int CC[] = {N_C6};
int duration(500);

void setup() {
  pinMode(6, OUTPUT); //Digital Pin 6 is where you connect your Buzzer
  Serial.begin(9600);
  Serial.println("Welcome to the Virtual Keyboard!");
  Serial.println("Notes: A-S-D-F-G-H-J");
  Serial.println("#: Q-W-E-R-T-Y-U");
}

void loop() {
  if (Serial.available()) {
    char ch = Serial.read();
    if (ch == 'a') {
    for (int Note = 0; Note < 1; Note++) {
      tone(6, C[Note], duration);
    }
    }
    if (ch == 'q') {
    for (int Note = 0; Note < 1; Note++) {
      tone(6, CS[Note], duration);
    }
    }
    if (ch == 's') {
    for (int Note = 0; Note < 1; Note++) {
       tone(6, D[Note], duration);
    }
    }
    if (ch == 'w') {
    for (int Note = 0; Note < 1; Note++) {
       tone(6, DS[Note], duration);
    }
    }
    if (ch == 'd') {
    for (int Note = 0; Note < 1; Note++) {
       tone(6, E[Note], duration);
    }
    }
    if (ch == 'f') {
    for (int Note = 0; Note < 1; Note++) {
       tone(6, F[Note], duration);
    }
    }
    if (ch == 'r') {
    for (int Note = 0; Note < 1; Note++) {
       tone(6, FS[Note], duration);
    }
    }
    if (ch == 'g') {
    for (int Note = 0; Note < 1; Note++) {
       tone(6, G[Note], duration);
    }
    }
    if (ch == 't') {
    for (int Note = 0; Note < 1; Note++) {
       tone(6, GS[Note], duration);
    }
    }
    if (ch == 'h') {
    for (int Note = 0; Note < 1; Note++) {
       tone(6, A[Note], duration);
    }
    }
    if (ch == 'y') {
    for (int Note = 0; Note < 1; Note++) {
       tone(6, AS[Note], duration);
    }
    }
    if (ch == 'j') {
    for (int Note = 0; Note < 1; Note++) {
       tone(6, B[Note], duration);
    }
    }
    if (ch == 'u') {
    for (int Note = 0; Note < 1; Note++) {
       tone(6, CC[Note], duration);
    }
    }
  }
}

Schematics

Schematics for Arduino Keyboard 2.0
That's how you should wire your Arduino Keyboard 2.0
Cattura rdvsm8mff6

Comments

Similar projects you might like

Arduino Keyboard

Project in progress by Gabriele Scordamaglia

  • 7,281 views
  • 16 comments
  • 15 respects

Keyboard Melodies

Project tutorial by Ava Baker -21 and Natalie Clark -20

  • 1,842 views
  • 2 comments
  • 8 respects

Electronic Piano Keyboard With Preset Songs

Project tutorial by Lindsay Fox

  • 77,973 views
  • 60 comments
  • 150 respects

Arduino + LEDs + MIDI Keyboard + MuseScore = Piano Tutor

Project tutorial by tcucinotta

  • 5,646 views
  • 3 comments
  • 14 respects

Arduino Programmed Keyboard Strikes

Project in progress by Sam

  • 855 views
  • 0 comments
  • 1 respect

A Pocket-Sized Touch Keyboard

Project tutorial by Amal Mathew

  • 3,587 views
  • 3 comments
  • 15 respects
Add projectSign up / Login