-
5Adjust Servo Values
Turn on the power supply and run the sample code provided (scales.ino). As shown below, adjust the servo min values as needed to ensure that the mallet strikes the xylophone key successfully.
//Parameters: (servo # on PCA9685, dynamic level, min. value, driver #) Note g1 = Note(0, 1, 86, 1);
-
6Write the Code to Perform a Tune
Using the Note class and methods provided in the sample code, write the code necessary for the robot to perform the tune of your choosing. You can use the Processing software to convert a MIDI file for the Arduino to read like we did or you can choose to write the code manually using the playNote command:
//plays a note for a given duration (millisec) g1.playNote(140);
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.