ashraf_minhaj
Published © GPL3+

TuneGlass: Can We Make MUSIC Using Our EYES???

A pair of Arduino glasses that can generate music / tone via a wearer's eyes.

IntermediateFull instructions provided4,378
TuneGlass: Can We Make MUSIC Using Our EYES???

Things used in this project

Story

Read more

Schematics

Circuit diagram

Code

Code snippet #2

Plain text
/*
 * Making music using Eye  

  * by: Ashraf Minhaj  

  * mail: ashraf_minhaj@yahoo.com  

  * license: General Public License  

*/

//connect sensors on
int sen1 = A0;  //A0
int sen2 = A1;  //A1

//Connect speakers (Not acutally buzzers)
int buz1 = 8;  //on digital pin 8
int buz2 = 9;  //digital 9

void setup()  // put your setup code here, to run once:
{
  pinMode(buz1, OUTPUT); //set pins as output
  pinMode(buz2, OUTPUT);

  Serial.begin(9600); //initialize serial com to see values

}

void loop() 
{
  // put your main code here, to run repeatedly:

  int val1 = analogRead(sen1);
  int val2 = analogRead(sen2);

  //print what's been read by the sensors
  Serial.println(val1);

  if(val1 < 750 && val2 < 750)
  {
    tone(buz1, 1000, 10);
  }

  else if(val1 < 750)
  {
  tone(buz1, 2000, 100);
  }

  else if(val2 < 750)
  {
    tone(buz1, 1500, 100);
  }

  
  //Serial.println(val2);

  //make sound
  
  

}

Github

https://github.com/ashraf-minhaj/TuneGlass

Credits

ashraf_minhaj

ashraf_minhaj

5 projects • 80 followers
Love to kill Soft things with Python and C++, Hard things with Soldering Iron.

Comments