Sensor Suara (FC-04)







Sensor Suara (FC-04)

1.Hardware [Kembali]

 Hardware

 Sensor Suara (FC-04)

 

2.Rangkaian Simulasi [Kembali]



3.Flowchart [Kembali]


4.Listing Program [Kembali]

// Mengontrol Motor dengan Suara
int sound = A0;
int sensor = 0;
int lampu = A1;
int m0 = 4;
int m1 = 5;
int m2 = 6;
int m3 = 7;
void setup()
{
Serial.begin (9600);
pinMode (sound,INPUT);
pinMode (lampu,OUTPUT);
pinMode (m0,OUTPUT);
pinMode (m1,OUTPUT);
pinMode (m2,OUTPUT);
pinMode (m3,OUTPUT);
}
void loop()
{
sensor = analogRead (sound);
analogWrite (m0,0);
analogWrite (m1,sensor);
analogWrite (m2,sensor);
analogWrite (m0,0);
if(sensor>60)
{
analogWrite (lampu,225);
delay(100);
analogWrite (lampu,0);
}
if (sensor<50)
{
analogWrite (m0,0);
analogWrite (m1,0);
analogWrite (m2,0);
analogWrite (m0,0);
}
Serial.println (sensor);
}

5. Video Simulasi [Kembali]


6. Link Download [Kembali]

•    Simulasi Proteus <Link Download>
•    Video <Link Download>

Tidak ada komentar:

Posting Komentar