This is the 5th phase in the making of our autonomous Biotronics Lego Walker. In this phase a piezo speaker is added on the robot's microcontroller. The Lawsin Linkage is also used in this experimental model.
This Biotronics project is made up of an Arduino Uno microcontroller, ultrasonic sensor HC-05 , an LED indicator, a piezo speaker, a microservo motor SG90 , a stepper motor 28BYJ-48, one power function, and LEGO's bricks and pieces.
Phase 5: Piezo Speaker Sketch
/////////////////////////////////////////////////////////////////////////////////////////////////
/*
Piezo Speaker Test
This is the 5th phase of The Biotronics Lego Project.
This sketch test a speaker on Arduino Uno.
The speaker will play 8 notes
The speaker is attached to digital pin 3
Sketched by J.B.Wylzan
*/
int speakerPin = 3;
int mNotes = 8;
int notes[] = {262, 294, 330, 349, 392, 440, 494, 523};
// middle C Do Re Mi Fa So La Ti Do
void setup()
{
pinMode(speakerPin, OUTPUT);
}
void loop()
{
for (int i = 0; i < mNotes; i++)
{
tone(speakerPin, notes[i]);
delay(500);
}
noTone(speakerPin);
/////////////////////////////////////////////////////////////////////////////////////////////
*Biotronics are robots in forms of insects, animals, and plants that look alive or with life. The word was coined by Lawsin in his book Creation by Laws. In technical term, Biotronics is the science of robots with self consciousness. Bio means life and tronics means intelligent electronics(neurotronics).
No comments:
Post a Comment