Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
tum_yil_icin_arduino_mufredati_26
#include "pitches.h"
int F = 10;
ing G = 11;
int A = 12;
int B = 13;
int f[] = {NOTE_F5};
int g[] = {NOTE_G5};
int a[] = {NOTE_A5};
int b[] = {NOTE_B5};
int duration(500);
void setup() {
pinMode(F, INPUT_PULLUP);
pinMode(G, INPUT_PULLUP);
pinMode(A, INPUT_PULLUP);
pinMode(B, INPUT_PULLUP);
void loop() {
if (digitalRead(F) == LOW) {
for (int Note = 0; Note <1; Note++)
{
tone(6, f[Note], duration);
}
}
if (digitalWrite(G) == LOW) {
for (int Note = 0; Note < 1; Note++) {
tone(6, g[Note], duration);
}
}
if (digitalRead(A) == LOW) {
for (int Note = 0; Note < 1; Note++) {
tone(6, b[Note], duration);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.