Microsoft MakeCode provides an exceptional environment for programming microcontrollers. The block-based coding includes capabilities that take advantage of board features.
MakeCode runs well with the Google Chrome browser in Chromebooks in addition to Microsoft Edge on PCs and other modern browsers.
Start your Chromebook and load the Chrome web browser (the Chrome icon looks like a four-color beach ball). Put the following into the address bar:
Microsoft will change the address slightly, no worries. You can click the star icon in your address bar to make this a favorite.
Select the board you are going to program.
Clicking the board will take you to a screen specific to the board you chose. Choosing Adafruit Circuit Playground Express takes you to https://makecode.adafruit.com/.
You have several choices at this point:
You can start a new project with the New Project button. If you have any previous projects, like mine titled "Untitled" from 7 months ago, they will appear next to New Project.
If you have a project on a disk, say on a flash drive or on your Google Drive in a file that ends in .UF2, then you can use the Import button circled above to load that file in for editing.
If you are working with an Adafruit tutorial and there is a link or button to the Microsoft MakeCode for the project, you can click that and it should automatically open in the editor in Chrome. As an example, the Adafruit tutorial MakeCode for Circuit Playground Express has an example near the bottom of this page that will download a UF2 code file of the color wheel example.
You will get a browser page such as the following:
You can work with the code in this window but it is best to load the code into the full MakeCode editor. Select the Edit button in the upper right and then you'll get a new browser tab with the full MakeCode program.
Note the large pink Download button in the lower left - we'll use it soon!
You use MakeCode on Chrome the same as on other operating systems at this point. See the following tutorials for information or https://www.microsoft.com/makecode for their tutorials:
When you have the code ready to load to your device, plug your device (such as an Adafruit Circuit Playground Express) to the Chromebook via a USB Male A to USB micro-B cable.
When you have your program ready to load, press the Reset button on the board once. For the Circuit Playground Express the circle of LED lights turns red then green. This means it is ready. The device should now be recognized by the Chromebook as a flash drive named CPLAYBOOT in the Files app.
Click the pink Download button in the MakeCode window. A File Save box pops up.
Save the file on whatever drive you wish. Using My Files -> Downloads is ok unless your teacher says otherwise, other choices could be your own connected flash/thumb drive.
Open the Files app and click on the drive you saved your file on (like My Files -> Downloads). Now you can drag that file name to the CPLAYBOOT drive. If you don't see a drive named CPLAYBOOT (or similar for other boards), then ensure that:
- You have the board connected via a good USB cable to the USB port of the Chromebook
- You have pressed the Reset button and the lights are green and you have a CPLAYBOOT (or similar for other boards) drive in the Files app.
Your program should now be running!
Whenever you make changes, you'll need to do the same steps of saving the file to a disk then dragging the uf2 file to the CPLAYBOOT drive, after it appears by pressing Reset on the board.
When you are done with your work, you should save your progress back to a file. Click the big pink Download button in the lower left. You'll get a screen like the one below:
Use the left panel to set where the file should be saved to. If you select My Files -> Downloads, they will be saved on the Chromebook. If you share the Chromebook, put a USB flash drive in and select it. You can consider using Google Drive also in this area.
The file name is circled in pink above. You can type any file name you want, but note you should use dashes between words instead of spaces. The end of the file must be .uf2 so it can be loaded on your project or in MakeCode later. When you have the save location and filename done, click the Save button.
You can use the Import button discussed previously to reload a .uf2 MakeCode file to use the code again.