T2W4: VEXCode IQ Programming
Last week we talked about the sensor modules available with our Generation 1 VEX IQ kits, and added sensors to the standard robot base to allow it to drive itself around and avoid obstacles in Autopilot mode. We will now use the autopilot robot to start our own programming efforts.
There are multiple ways to program the VEX IQ "brain" units but we will use VEXCode IQ Blocks, which allow us to build programs visually by arranging blocks of code in a Scratch or MakeCode like programming environment. Using your Lowell Chromebooks, visit https://codeiq.vex.com to load the programming environment:
You can explore the tutorials, example programs, and command blocks available in the environment without having a robot connected. But to download programs and run them on the robot, you will need to connect the robot brain to your Chromebook using a USB A to micro USB cable, which is available in many of the robot bins - look around or ask Tim if you don't have one in your kit.
To connect your robot brain, plug the USB A (rectangular) connector into your Chromebook on the left side, and plug the smaller micro USB plug into the upper left side of the brain module. Then turn the brain module on by pressing the check mark button, click on the "BRAIN" icon at the top of the window and press the "Connect" button. The VEXCode software will look for the brain module and ask you to select the first from the list of USB serial devices that opens up. The BRAIN icon should turn green to indicate that the program is connected to your robot brain module.
You can download programs to the VEX IQ brain by clicking the "DOWNLOAD" icon. The program will show up in the numbered list of downloaded programs as "VEXcodeProject" and you can move the cursor to highlight and run the program.
Click in the field labeled "VEXcode Project" by the hexagon to rename your project, and click on File->Save To Your Device to save a copy of the project to your Chromebook. You can load your project from your Chromebook's storage next time by selecting File->Load From Your Device.
For the rest of the class time, watch some of the tutorials under the TUTORIALS icon, and take a look at the same programs under File->Open Examples. Try modifying one of the example programs and downloading it to your robot brain to make sure everything works!
We will cover how to add and configure sensors and devices next week, so for today you will mostly just have access to program elements that run on the VEX brain unit itself - try the "print" block to display messages and the "play sound" block to make noises.
Robot of the Week
Each week I will find a quick video of a different robot companions, to help inspire your own creations. This week's robot is Atlas from Boston Dynamics, starring a new video where it jumps, picks up, and throws things: