6.7 KiB
6.7 KiB
micro:bit/JavaScript Documentation
JavaScript docs for the micro:bit
@section full
@parent reference
@short JavaScript
~hint
Spotty internet? No problem! (1) When online, go to https://www.microbit.co.uk/app/ and bookmark this URL; (2) use the bookmark to reload the web app, even without the internet.
~
Welcome to the Touch Develop home page for the BBC micro:bit. Below you will find resources about the Touch Develop programming language and code editor. Good places to start include:
~column
Language
Variables
Types
Statements and control structures
Maths
- arithmetic operators (
+
,-
,*
,/
, mod) on Numbers - comparison operators (such as
>
,=
) on Numbers - the math library
- the bits library
Logical
Strings
Functions
Collections
- read the collections tutorial
Custom object types
- see the object types tutorial
- read the object disclaimer if you're an advanced user
Libraries
Documentation
~
~column
BBC micro:bit functions
Basic
LED
- brightness
- fade in
- fade out
- plot
- plot all
- point
- screenshot
- set display mode
- set brightness
- stop animation
- toggle
- toggle all
- unplot
Input
- acceleration
- rotation
- button is pressed
- compass heading
- temperature
- running time
- on shake
- on button pressed
- on logo down
- on logo up
- on pin pressed
- on screen down
- on screen up
- pin is pressed
Image
Music
Pins
- digital read pin
- digital write pin
- analog read pin
- analog write pin
- analog set period
- analog pitch
- analog set pitch pin
- servo write pin
- servo set pulse
- map
Control
Devices
Functions in this category require to be connected to a remote device.
Libraries
~
~column
Run
Debugging
- use the serial library to print data from your micro:bit on your computer
- learn about the device error codes that are displayed when sad faces occur