Welcome to the STeaMi MakeCode Editor repository! This repository provides the MakeCode environment for the STeaMi educational development board, designed to facilitate learning programming and electronics in an engaging and interactive way.
STeaMi is an educational board aimed at introducing students, educators, and enthusiasts to the basics of programming, electronics, and STEM concepts. The board is designed with simplicity and versatility in mind, providing a powerful platform for learning through hands-on experience.
The STeaMi board is equipped with several features to help learners experiment, including:
- Multiple programmable inputs and outputs.
- Integration with common sensors and actuators.
- Easy connectivity with other devices, including direct programming through MakeCode.
This repository hosts the MakeCode editor configuration and extensions for the STeaMi board. The editor provides a block-based coding environment ideal for beginners, with support for JavaScript for those who wish to take their skills further.
- Simulation Support: Users can simulate their STeaMi programs directly in the browser, visualizing how their code will interact with the board's components.
- WebUSB Upload: Directly upload code to the STeaMi board using WebUSB, making the programming workflow smoother and more efficient.
- Interactive Blocks and JavaScript: Program using drag-and-drop blocks or switch to JavaScript to learn and practice text-based coding.
To get started with the STeaMi MakeCode editor:
- Clone or download this repository.
- Open the MakeCode editor for STeaMi (https://makecode.steami.cc).
- Start creating your first project using either blocks or JavaScript.
- Use the WebUSB Upload feature to upload your project to your STeaMi board.
- WebUSB: You need a browser that supports WebUSB (such as Chrome or Edge).
- STeaMi Board: Ensure your board is connected via USB and powered on.
To run the MakeCode editor locally:
- Install Node.js and npm if they are not already installed.
- Clone this repository:
git clone https://github.com/steamicc/makecode-steami
- Navigate to the cloned directory:
cd makecode-steami
- Set up the environment by running the setup target:
make setup
- Build the project:
make build
- Start the local server:
make serve
- Open the editor in your browser at
http://localhost:3000
.
This project uses a Makefile to handle various PXT commands such as serve
, run
, update
, and more. Each command can be run by simply invoking make <command>
. For instance:
make serve
By default, each PXT command comes with predefined arguments, which can be customized according to your needs. Below is a list of the default arguments for each command:
- add: (No default arguments)
- buildcss: (No default arguments)
- buildjres: (No default arguments)
- buildsimjs: (No default arguments)
- buildsprites: (No default arguments)
- buildtarget: --localbuild --force
- bump: (No default arguments)
- checkdocs: (No default arguments)
- checkpkgcfg: (No default arguments)
- ci: (No default arguments)
- console: (No default arguments)
- deploy: (No default arguments)
- extract: (No default arguments)
- init: (No default arguments)
- install: (No default arguments)
- npminstallnative: (No default arguments)
- run: (No default arguments)
- serve: --localbuild --rebundle --noauth --no-browser --no-serial -h '0.0.0.0'
- staticpkg: -o ../static/ --localbuild
- tag: (No default arguments)
- testghpkgs: (No default arguments)
- update: (No default arguments)
- usedblocks: (No default arguments)
The naming of the variables containing the default parameters follows a consistent pattern. Each variable that holds default arguments is named as:
PXT_<COMMAND>_ARGS
Where:
PXT
: This prefix indicates that the variable is related to PXT commands.<COMMAND>
: The name of the specific PXT command, written in uppercase. For example,DEPLOY
for thedeploy
command._ARGS
: This suffix denotes that the variable contains arguments to be passed to the specified command.
PXT_DEPLOY_ARGS
: Contains the default arguments for thedeploy
command.PXT_RUN_ARGS
: Contains the default arguments for therun
command.PXT_UPDATE_ARGS
: Contains the default arguments for theupdate
command.
If you need to override the default arguments, you can do so by specifying them directly in the command line when invoking make
. To modify the default parameters for any PXT command, you can override the variable directly when calling make
. For instance:
make run PXT_RUN_ARGS="--hardware --verbose"
This command will run the run
target with custom arguments (--hardware --verbose
), overriding the default value set in PXT_RUN_ARGS
.
This naming convention makes it easy to customize arguments for each command. This flexibility allows you to tailor the PXT commands to match your specific development or deployment requirements without modifying the Makefile itself.
To run the serve
command with custom arguments:
make serve PXT_SERVE_ARGS="--port 8080 --no-browser"
This repository is configured to be used with a development container (Dev Container), which allows for an easy and consistent development environment.
- Install Docker: Ensure you have Docker installed on your system. You can download it from Docker's official website.
- Install VS Code: You will also need Visual Studio Code, which you can get from VS Code's official website.
- Install Remote - Containers Extension: In VS Code, install the Remote - Containers extension from the Extensions Marketplace.
- Open the Repository in Dev Container:
- Open the STeaMi MakeCode repository in VS Code.
- You should see a prompt asking if you want to reopen the repository in a Dev Container. Click Reopen in Container.
- VS Code will then build and open the development environment inside a container, setting up all necessary dependencies automatically.
Using a Dev Container ensures that all contributors have the same environment, minimizing issues related to different system configurations.
Contributions are welcome! If you want to contribute:
- Fork this repository.
- Create a new branch for your feature or bug fix.
- Submit a pull request with a detailed description of your changes.
Please make sure to follow the coding guidelines and document your changes where necessary.
This project is licensed under the MIT License. See the LICENSE file for more details.
For any questions or support, feel free to open an issue or reach out via email at [email protected].
The STeaMi project is inspired by educational initiatives like BBC micro:bit, aimed at making programming accessible and enjoyable for all learners.