1. Home
  2. /
  3. Makecode
  4. /
  5. Tilt Detection

Tilt Detection - Makecode Typing CST Test

Loading…

Tilt Detection — Makecode Code

Displays a message when the micro:bit is tilted left or right.

basic.forever(function () {
	if (input.isGesture(Gesture.TiltLeft)) {
		basic.showString("Left")
	} else if (input.isGesture(Gesture.TiltRight)) {
		basic.showString("Right")
	}
})

Makecode Language Guide

Microsoft MakeCode is a block- and text-based coding platform for creating interactive programs, games, and hardware projects using microcontrollers like micro:bit, Circuit Playground Express, and more.

Primary Use Cases

  • ▸Teaching coding and computational thinking
  • ▸Creating microcontroller-based projects
  • ▸Prototyping simple games and simulations
  • ▸Interactive electronics with sensors and LEDs
  • ▸STEM workshops, classrooms, and maker labs

Notable Features

  • ▸Block-based drag-and-drop programming
  • ▸Text editor support for JavaScript and Python
  • ▸Hardware simulation environment
  • ▸Extensive hardware extensions and libraries
  • ▸Cross-platform web-based IDE with offline apps

Origin & Creator

MakeCode was developed by Microsoft around 2016 as an educational platform to teach coding and electronics to students using a low-barrier, interactive environment.

Industrial Note

Primarily used in education, STEM learning, and maker projects; not intended for large-scale commercial software development.

More Makecode Typing Exercises

Hello World in MakeCode (JavaScript view)Scroll Text on micro:bitDisplay a Heart IconBlink an LEDButton A Pressed MessageCount from 1 to 5Display Random NumberShow Multiple IconsTemperature Display

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher