pxt-calliope/docs/about.md
Juri Wolf a93febb5b7
Map and clean deprecated functions (#175)
* add image and deprecated arrow functions

* update locales

* map basic.showArrow

* map arrow blocks

* map & remove arrow images

* remove arrow blocks

* update locales

* remove & patch:
rgbw -> rgb
button/pin pressed -> button/pin event
loudness -> soundLevel

* update ts mappings for arrows

* add wip ts patch rules

* update .blocks files

* use Click instead of Down as default in Documentation and tests

* patch test.blocks

* fix lowercase name tag

* update test.blocks

* update blocks test files

* update blocks test files

* format block files

* pass blocks file tests

* fix ts mapping

* fix color.defl value

closes https://github.com/microsoft/pxt-calliope/issues/136

* fix ts mappings

- add optional spacing at the end of rgbw()
- map up to v4.0.19

* add suggested changes

* replace innerText by textContent

Co-authored-by: JW <gitkraken@juriwolf.de>
Co-authored-by: Juri <info@juriwolf.de>
2022-04-26 10:28:42 -07:00

3.9 KiB

About

@description A Blocks / Javascript code editor for the Calliope mini, a pocket-size computer with 5x5 display, sensors and Bluetooth.

The Calliope mini is a pocket-size computer with a 5x5 display of 25 LEDs, Bluetooth and sensors that can be programmed by anyone.

The Calliope mini provides an easy and fun introduction to programming and making ??? switch on, program it to do something fun ??? wear it, customize it. Just like Arduino, the Calliope mini can additionally be connected to and interact with sensors, displays, and other devices.

Hardware: The Device

The Calliope mini is packaged with sensors, radio and other goodies. Learn about the hardware components of the Calliope mini to make the most of it!

~ hint

Looking to buy a Calliope mini? See the list of resellers.

~

Programming: Blocks or JavaScript

You can program the Calliope mini using Blocks or JavaScript in your web browser via the Calliope mini APIs:

input.onButtonEvent(Button.A, ButtonEvent.Down, () => {
    basic.showString("Hi!");
})
input.onButtonEvent(Button.A, ButtonEvent.Down, () => {
    basic.showString("Hi!");
})

The editor work in most modern browsers, work offline once loaded and do not require any installation.

Compile and Flash: Your Program!

When you have your code ready, you connect your Calliope mini to a computer via a USB cable, so it appears as a mounted drive (named MINI). If you are using the Calliope mini REV2 you also see another drive (FLASH) that handels up to 25 additional programs.

Compilation to ARM thumb machine code from Blocks or JavaScript happens in the browser. You save the ARM binary program to a file, which you then copy to the micro:bit drive, which flashes the micro:bit device with the new program.

Simulator: Test Your Code

You can run your code using the micro:bit simulator, all within the confines of a web browser. The simulator has support for the LED screen, buttons, as well as compass, accelerometer, and digital I/O pins.

basic.forever(() => {
  basic.showString("Hi!");
})
input.onButtonEvent(Button.A, ButtonEvent.Down, () => {
    led.stopAnimation();
    basic.showLeds(`
. . . . .
. # . # .
. . . . .
# . . . #
. # # # .`);
});
input.onButtonEvent(Button.B, ButtonEvent.Down, () => {
    led.stopAnimation();
    basic.showLeds(`
. # . # .
# . # . #
# . . . #
. # . # .
. . # . .`);
});

Learn!

We have tons of projects, examples and courses to get your started!

C++ Runtime

The C++ micro:bit runtime, created at Lancaster University, provides access to the hardware functions of the micro:bit, as well as a set of helper functions (such as displaying a number/image/string on the LED screen).

The micro:bit library mirrors the functions of the C++ library. When code is compiled to ARM machine code, the calls to JavaScript micro:bit functions are replaced with calls to the corresponding C++ functions.

Command Line Tools

Looking to use @homeurl@ in your favorite editor? Install the command line tools and get rolling!

Extensions

Create, edit and distribute your own blocks and JavaScript using extensions. Extensions are hosted on GitHub and may be written using C++, JavaScript and/or ARM thumb.

Open Source

The code for the Calliope mini is open source on GitHub. Contributors are welcome!

radio