The block editor is the easiest way to get started with MakeCode Maker. You can drag and drop blocks from the category list. Each time you make a change to the blocks, the simulator will automatically restart and run the code. You can test your program in the browser! The simulator will also generate the wiring for your breadboard for simple programs.
Blinky!
The animation above shows to use the blocks to create a program that blinks an LED.
Creating a blink effect is done by setting the pin HIGH, pause for a little, then set the pin LOW, pause for a little, then repeat forever.
- forever runs blocks in a loop with a 20ms pause in between (it is similar to Arduino loop).
- digital write pin sets the pin to high or low
- pause blocks the current thread for 100ms. If other events or forever loops are running, they have the opporunity to run in parallel.
Text editor powered by tinymce.