Sprint 2 - P-Division-2018-2019/Team-11 GitHub Wiki

Name : Accepting tune

Fabrication Plan

For choice of tune we have designed the user defined function. We have given four different types of tunes so that user can play his/her favourite tune. To implement this idea we have used Bluetooth module HC05. And also we have designed app(MIT APP) through which the user can enter tune. This app is operated through the phone by scanning the required QR code.
Description of tunes:

  1. Sweep :- The mallets just sweep from one end to other end.
  2. tune 2 :- As we have two similar bots the first bot bang first four keys and sweeps those keys and the second bot bangs second four keys and sweeps it.
  3. Jingle bell tune :- Third tune we have given tune of jingle bell song.
  4. Wheels on the bus :- The last tune was the rhyme the wheels on the bus.

Interaction

sub system
material interactions no
energy interactions yes
data intertactions yes
spatial interactions no

Program

#include <Servo.h>

Servo myser1; Servo myser2; Servo myser3; Servo myser4; int posb; int posa; int i,j; void setup() { // put your setup code here, to run once: myser1.attach(7);//top 1 myser3.attach(6);//top 2 myser2.attach(9);//bottom 1 myser4.attach(8);//bottom 2 Serial.begin(9600); }

void loop() { // put your main code here, to run repeatedly: char blue=Serial.read(); //tune 1 if(blue=='1') { myser1.write(0); if(posb<60) //full sweep posb=posb+70; else posb=0; myser2.write(posb); // bottom delay(1000); }

//tune 2 if(blue=='2') { for(i=0;i<4;i++) { if(posa<40) { posa=posa+10; } else posa=0; myser4.write(posa); delay(100); up2(); } for(j=0;j<4;j++) {

      if(posb<40)
      {
        posb=posb+10;
      }
      else
        posb=0;
      myser2.write(posb);
      delay(100);
      upper();
  }

}
//tune 3 if(blue=='3') { myser2.write(45); for(i=0;i<3;i++) { upper(); delay(50); } delay(500); for(i=0;i<3;i++) { upper(); delay(50); } delay(200); upper(); delay(100); myser2.write(35); upper(); delay(100); myser2.write(55); upper(); delay(100); upper(); delay(100); myser2.write(45); upper(); delay(100);

} //tune 4 wheels on the bus if(blue=='4') { myser2.write(70); upper(); delay(100); for(i=0;i<4;i++) { myser2.write(45); upper(); delay(50); } myser2.write(20); upper(); delay(100); myser2.write(42); upper(); delay(100); myser2.write(30); upper(); delay(100); myser2.write(52); upper(); delay(100); myser2.write(70); upper(); delay(100); myser2.write(2); upper(); delay(100); myser2.write(20); upper(); delay(100); myser2.write(42); upper(); delay(100); myser2.write(68); upper(); delay(100); }

}

void upper() {

    myser1.write(30);
    delay(150);
    myser1.write(0);
    delay(150);

} void up2() { myser3.write(44); delay(150); myser3.write(0); delay(150); }

Built subsystem photo

IMG-20190507-WA0007

⚠️ **GitHub.com Fallback** ⚠️