LET'S UPLOAD CONTROLLER CODE TO YOUR ARDUINO MICRO
In our last step, we used BlocklyDuino to do what's called "processing." We use BlocklyDuino to start because it uses block coding which is a great way to learn how the code works. What we will use in this next step is called Arduino Create which a cloud based processing program like BlocklyDuino but without block coding. Another popular processing tool is called Arduino IDE which is a program you download to your computer. Moving away from the block coding, we are getting into programs that are used by electrical engineers to create some amazing things!
And guess what? The next step involves Minecraft.
Click OPEN CODE in the embedded Arduino Create window to the right and add then ADD TO MY SKETCHBOOK. Connect the USB from your Command Center to the computer you are using, then SELECT THE BOARD OR PORT the Arduino Micro is connected to. Lastly, hit the right arrow button to UPLOAD AND SAVE. This will transfer the code to your Piper Command Center.
Curious about what's in the code you're uploading? In addition to the annotations in the code, here's a quick guide:
Pull the libraries, files written in C or C++ which provide your sketches with extra functionality. Use Keyboard which programs keystrokes sent and Mouse which controls cursor movement on an attached computer.
This maps where each of buttons are plugged into the Micro pins
If joystick is pressed down, then the joystick controls (vertical/horizontal) kick in
Codes how the XY potentiometers map onto analog displays
These lines code the correct pins to the components of the keyboard and mouse libraries.
Release the buttons that were selected (essentially an OFF switch for each button)
Slow down the mouse movement by adding a delay so the joystick isn't too sensitive
Define that each of the buttons are inputs being used by the code.