MakeCode: Difference between revisions
Line 11: | Line 11: | ||
So far (Aug 2019), it works with the '''Circuit Playground Express''' board of the [[Adafruit FLORA]] system. Code can be directly downloaded into board via USB. It will be compiled into some kind of machine language. | So far (Aug 2019), it works with the '''Circuit Playground Express''' board of the [[Adafruit FLORA]] system. Code can be directly downloaded into board via USB. It will be compiled into some kind of machine language. | ||
== Example == | |||
=== Block code === | |||
The following code will activate on shaking the board and repeat four times a sound and a blinking (from blue to red/yellow) since one ring is shown one after the other. | The following code will activate on shaking the board and repeat four times a sound and a blinking (from blue to red/yellow) since one ring is shown one after the other. | ||
Line 17: | Line 21: | ||
The corresponding JavaScript code is | The corresponding JavaScript code is | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
input.onGesture(Gesture.Shake, function () { | input.onGesture(Gesture.Shake, function () { | ||
Line 33: | Line 38: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Downloading === | |||
[[image:Adafruit-makecode-2.png|thumb|500px|none|AdaFruit MakeCode download for Circuit PlayGround Express]] | |||
== Links == | == Links == |
Revision as of 17:00, 23 August 2019
Introduction
“Microsoft MakeCode brings computer science to life for all students with fun projects, immediate results, and both block and text editors for learners at different levels.” (Hands on computing education, retrieved August 22, 2019).
Makecode looks similar to Snap! and Scratch, i.e. it is a visual programming language. It also allows saving and working with JavaScript code.
Adafruit MakeCode
The online MakeCode editor at AdaFruit, is https://makecode.adafruit.com/. The site includes some walk-through tutorials and some examples. The platform includes that familiar palette with programming elements, a workspace for the program, and a simulator to the left.
So far (Aug 2019), it works with the Circuit Playground Express board of the Adafruit FLORA system. Code can be directly downloaded into board via USB. It will be compiled into some kind of machine language.
Example
Block code
The following code will activate on shaking the board and repeat four times a sound and a blinking (from blue to red/yellow) since one ring is shown one after the other.
The corresponding JavaScript code is
input.onGesture(Gesture.Shake, function () {
for (let i = 0; i < 4; i++) {
music.magicWand.play()
light.showRing(
`blue blue blue blue blue blue blue blue blue blue`
)
light.showRing(
`yellow red yellow red yellow yellow red red red yellow`
)
pause(500)
}
light.clear()
})