-
Notifications
You must be signed in to change notification settings - Fork 15
Arduino Basics
RobOrchestra instruments are all controlled by Arduinos that are programmed to interpret MIDI messages. To work with the Arduino code of new or existing robots, download the free Arduino software. You will also need to install the Arduino MIDI library: Arduino_MIDI_Library_v4.3.1.zip. Download the zip folder, unzip it, and move the folder named "MIDI" to your Arduino/libraries folder. The Pixy2 library (for working with the camera) can be downloaded here: https://pixycam.com/downloads-pixy2/
To test that the MIDI library has installed correctly, open up the file Drum_Servo_MIDI.ino located on the RobOrchestra repository in the folder Examples/Drum_Servo_MIDI. The Arduino software should open the file. Click on the check icon in the top bar to verify the code. If the sketch compiles, you have successfully installed Arduino and the MIDI library
To upload your code to an Arduino board, you will need to connect the Arduino to your computer with a USB cable. Then, open the code you wish to upload in the Arduino software. In the toolbar, navigate to Tools>Board and select the type of board you have connected. Then go to Tools>Port and click on the listed COM port. You can now click the blue arrow icon to upload your code to the connected board. Any errors in uploading will appear in the console. Before uploading code to a board, it is good practice to verify the code(make sure it compiles) by clicking the check icon.
Check out the Language Reference for Arduino. You can also look at example code by opening the Arduino software and going to File>Examples in the top toolbar.
###Servos Servo motors are used in all of our percussion robots to control the drum sticks. There is example code for general servo control with Arduino in the File>Examples section of the top toolbar in the Arduino software. A good RobOrchestra specific example is on the GitHub repo in the folder Examples/Drum_Servo_MIDI. ###Solenoids Solenoids are used in Xylobot to hit the keys, and in Ukulelebot to press down the strings. You can control a solenoid with an Arduino by telling it when to push out its pin. A nice tutorial for solenoids with Arduino can be found on BC-Robotics. Simple example code can be found on the Github repo under Examples/Solenoid_Example ###MIDI Library Documentation for the MIDI library can be found on the Arduino MIDI Library Github page. A template for how a RobOrchestra instrument uses the library can be found on the Github repo under Examples/MIDI_Template.