SlideShare a Scribd company logo
micro:bit
microbit Microbit programming Microbit programming
FEATURES
• The micro:bit board, an ARM-based development board
• It is a very easy to use and includes a lot of peripherals
• No need for soldering or use of external hardware to get started with
• The processor is an nRF51
• It has 16 KB of RAM and 256 KB of FLASH
FEATURES
• The micro:bit has 19 GPIOs available as assignable. Up to 3 can be
assigned as PWM pins and 6 as analog inputs. The ADC of the
processor has a resolution of 10 bits
• The GPIOs also have support for I2C, SPI and Serial communication
interfaces
• The board has a Freescale MKL26Z128VFM4 microcontroller, which is
responsible for handling the USB connection between the micro:bit
board and a computer, and also for the flashing of new code.
• The micro:bit board is detected as a USB disk when connected to our
computer
Digital / Analog
FEATURES
• The micro:bit board has several peripherals on board (I2C)
• It has a Freescale MMA8653FC, a 3-axis accelerometer with a resolution of 10 bits.
• It also has an on board Freescale MAG3110 magnetometer, which allows to get
magnetic field strength measurements (I2C)
• The nRF51 processor has an integrated temperature sensor with a resolution of, 0.25°C
and an accuracy of +-4°C.
• The board has 2 two buttons for user input. There is an additional button that allows to
reset the system.
• The micro:bit board also has a 5×5 LED matrix for display purposes
• The micro:bit board has a 2.4 GHz transceiver, which allows it to support Bluetooth low
energy to establish communication with other devices
• Besides Bluetooth, the radio of the board also allows the use of the Nordic Gazell
protocol, which is a proprietary protocol that allows communication between devices
that support it. This protocol operates on the 2.4 GHz, like Bluetooth.
PROGRAMMING ENVIRONMENTS
• The micro:bit has many development environments available, some
of them designed to make it easy for beginners to get started, as
Microsoft’s MakeCode
• This editor offers the possibility of simulating the code execution very
easily. A model of the micro:bit board is located at the left side of the
code editing window and by the click of a button testing starts
• In terms of higher level languages, the micro:bit can be programmed
in Java, Python or C
MakeCode
• https://www.dfrobot.com/product-1587.html
• https://makecode.microbit.org/
• https://makecode.microbit.org/offline
• https://makecode.microbit.org/projects/
microbit Microbit programming Microbit programming
The micro:bit - a reactive system
• There are different types of computing systems, to address different kinds
of problems that arise in practice: transaction processing systems are used
by banks to handle huge numbers of financial transactions by their
customers; distributed systems make a set of networked computers appear
as one big computer (like Google’s search engine); there are also parallel
systems, such as graphic cards, which perform a huge number of primitive
operations simultaneously, using a great number of small processing cores.
• The micro:bit is a reactive system – it reacts continuously to external
events, such as a person pressing the A button of the micro:bit or shaking
the device. The reaction to an event may be to perform a computation,
update variables, and change the display. After the device reacts to an
event, it is ready to react to the next one. If this sounds like a computer
game, that’s because most computer games are reactive systems too!
The micro:bit - a reactive system
• A responsive system is able to do several things at the same time. As the micro:bit
only has one CPU it can only execute one program instruction at a time.
• The micro:bit can execute millions of instructions per second, so it is possible for
the device to alternate among instruction sequences of different programs.
• Let’s think about three sequences of instructions:
• Sequence S1: contains the instructions (let’s say several hundred thousand or so) that scroll
the number 42 across the LED screen.
• Sequence S2: contains a few instructions to check if button A is pressed.
• Sequence S3: contains a few instructions to increment a counter.
• The micro:bit interrupts the execution of sequence S1 periodically to execute the
sequence S2, which will check if button A is pressed, which looks like:
The micro:bit - a reactive system
• The result is that it takes sequence S1 a little longer to complete, due
to the interruptions to execute sequence S2, but we are checking
often enough to detect a press of button A . When S2 detects a press
of button A, then the sequence S3 can be executed before S1
resumes:
microbit Microbit programming Microbit programming
microbit Microbit programming Microbit programming
microbit Microbit programming Microbit programming
microbit Microbit programming Microbit programming
microbit Microbit programming Microbit programming
microbit Microbit programming Microbit programming
microbit Microbit programming Microbit programming
microbit Microbit programming Microbit programming
microbit Microbit programming Microbit programming
microbit Microbit programming Microbit programming
microbit Microbit programming Microbit programming
microbit Microbit programming Microbit programming
EXAMPLES
• Go to https://makecode.microbit.org/projects/
• Program examples
• Flashing Heart
• Name Tag
• Rock Paper Scissors
• Mood Radio
• Fireflies
• Go to https://www.dfrobot.com/product-1587.html
• Program Microbit Project 13:
MAQUEEN
MAQUEEN
MAQUEEN
• Supply Voltage: 3.5V-5V DC ( Three AAA batteries or 3.6V~3.7V lithium
battery )
• Infrared Grayscale Sensor(High-low level) x 2
• Buzzer x 1
• Infrared Receiver (NEC decoder) x 1
• LED Lights (High-low level control) x 2
• RGB Ambient Light (16 million colors) x 4
• SR04, SR04P Ultrasonic Interface(5V) x 1
• IIC Interface (3.3V) x 1
MAQUEEN
• Gravity Extension Interfaces (P1, P2) x 2
• N20 All-metal Gear Motor x 2
• Motor Reduction Ratio: 1:150
• Maximum Rotate Speed: 133 rpm
• Motor Drive Mode: PWM motor drive
• Bracket and Protective Cover Extension M3 Screw Hole x 6
• Programming Method: Makecode graphical programming, Mind graphical
programming (based on Scratch 3.0)
• Dimension: 81mm x 85 mm x 44mm/3.19 x 3.35 x 1.73in
• Weight: 75.55g
MAQUEEN
• Go to
https://wiki.dfrobot.com/micro:Maqueen_for_micro:bit_SKU:ROB01
48-E(ROB0148)
• Import the Makecode Graphical Library
CONTINUATION ACTIVITIES
• Download the “Terminal” at https://sites.google.com/site/terminalbpp/
• Practice the “Serial” commands
• Use the online help or visit https://makecode.microbit.org/reference/serial
• Practice the “Text” commands
• Use the online help or visit https://makecode.microbit.org/reference/text
• For the sensors “Temperature,” “Acceleration,” and “Compass,” write
programs that send the read values to the computer. Try to make the
sensor values change; consider using “pause.”
• For the Acceleration, what is the meaning of the negative values?
• For the Compass, is there any difference in the readings when the micro:bit is
horizontal, compared to when it is vertical?
CONTINUATION ACTIVITIES
• This program requires the text
terminated with CR+LF. On
terminal v1.93 you do this as
indicated in the figures below.
Check both boxes.
CONTINUATION ACTIVITIES
• For the Maqueen
• Write a program that measure distance and send to the screen
• Study the object avoidance example
• Study the line-following example, write your own version.
CONTINUATION ACTIVITIES
• This program reads the distance
from the ultrasonic sensor and
sends the value to the UART
SENDING TEXT OVER BLUETOOTH
SENDING TEXT OVER BLUETOOTH
• This functions receives “text”, a
text argument
• If the length of text exceeds the
Bluetooth capacity, an “X” is
shown, and the program gets
locked
• Else “text” is sent over Bluetooth
SENDING TEXT OVER BLUETOOTH
• This function rounds a number to two decimal places
• The result is stored in “roundResult” as text, there is not any function
to round decimal paces in MakeCode.
SENDING TEXT OVER BLUETOOTH
• This program calculates the
square root of a sequence of
numbers
• “on start” initializes Bluetooth
and the first number to obtain
the square root
• Show index is used to provide
feedback to the user

More Related Content

PPTX
Introduction to Microcontrollers
Venkata Sai Vamsi Penupothu
 
PDF
Iot Bootcamp - abridged - part 1
Marcus Tarquinio
 
PPTX
An_Introduction_to_Microcontrollers.pptx
Stefan Oprea
 
PPTX
ARDUINO AND RASPBERRYPI.pptx
vennetikiran1
 
PPTX
MICRO WAVE LAB AND VIEW UNIT 1 RECENT.pptx
manforlover7
 
PPTX
2nd ARM Developer Day - NXP USB Workshop
Antonio Mondragon
 
PDF
FRDM-KL46Z_Hands-On_Presentation_v02
Libor GECNUK
 
PPTX
Microcontroller from basic_to_advanced
Imran Sheikh
 
Introduction to Microcontrollers
Venkata Sai Vamsi Penupothu
 
Iot Bootcamp - abridged - part 1
Marcus Tarquinio
 
An_Introduction_to_Microcontrollers.pptx
Stefan Oprea
 
ARDUINO AND RASPBERRYPI.pptx
vennetikiran1
 
MICRO WAVE LAB AND VIEW UNIT 1 RECENT.pptx
manforlover7
 
2nd ARM Developer Day - NXP USB Workshop
Antonio Mondragon
 
FRDM-KL46Z_Hands-On_Presentation_v02
Libor GECNUK
 
Microcontroller from basic_to_advanced
Imran Sheikh
 

Similar to microbit Microbit programming Microbit programming (20)

PPTX
POWER EFFICIENT SOFTWARE DEFINED RADIO FOR DISASTER AFFECTED REGIONS USING R...
Nishmi Suresh
 
PPTX
Internet of Things prescribed by University
Sanjay Kumar
 
PDF
arduinoworkshop-160204051621.pdf
AbdErrezakChahoub
 
PPTX
Ardui no
Amol Sakhalkar
 
PDF
Multipilot pres-ufficiale def
Roberto Navoni
 
PPTX
Embedded Systems Design and Programming & Internet of Things
Vasundhara Sharma
 
PPTX
IOT beginnners
udhayakumarc1
 
PPTX
IOT beginnners
udhayakumarc1
 
PDF
CV Damien Boissat 2016
Damien Boissat
 
PDF
Advanced view of atmega microcontroller projects list at mega32 avr
WiseNaeem
 
PDF
Embedded system and its platforms
Mrunal Deshkar
 
PPT
Networking of Micro-Controllers through USB
pranjal009
 
PPTX
RTOS based Confidential Area Security System
ajinky gadewar
 
PPTX
TMSLF2407 DSP Controller
ANIRUDDHMAINI1
 
PPTX
Project_updated
Shaikh Zaid
 
PPTX
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
MeghdeepSingh
 
DOC
REPORT texto braillefinal
ASWATHI K
 
PPTX
Autoboxing n automation meta data for education
PatilSiddh1
 
PPTX
embedded system and AVR
Urvashi Khandelwal
 
PPTX
Summer training embedded system and its scope
Arshit Rai
 
POWER EFFICIENT SOFTWARE DEFINED RADIO FOR DISASTER AFFECTED REGIONS USING R...
Nishmi Suresh
 
Internet of Things prescribed by University
Sanjay Kumar
 
arduinoworkshop-160204051621.pdf
AbdErrezakChahoub
 
Ardui no
Amol Sakhalkar
 
Multipilot pres-ufficiale def
Roberto Navoni
 
Embedded Systems Design and Programming & Internet of Things
Vasundhara Sharma
 
IOT beginnners
udhayakumarc1
 
IOT beginnners
udhayakumarc1
 
CV Damien Boissat 2016
Damien Boissat
 
Advanced view of atmega microcontroller projects list at mega32 avr
WiseNaeem
 
Embedded system and its platforms
Mrunal Deshkar
 
Networking of Micro-Controllers through USB
pranjal009
 
RTOS based Confidential Area Security System
ajinky gadewar
 
TMSLF2407 DSP Controller
ANIRUDDHMAINI1
 
Project_updated
Shaikh Zaid
 
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
MeghdeepSingh
 
REPORT texto braillefinal
ASWATHI K
 
Autoboxing n automation meta data for education
PatilSiddh1
 
embedded system and AVR
Urvashi Khandelwal
 
Summer training embedded system and its scope
Arshit Rai
 
Ad

More from ssuser5feb2c1 (7)

PPT
Introductory level to Arduino programming
ssuser5feb2c1
 
PPTX
introduction to Dialogflow ES process.pptx
ssuser5feb2c1
 
PDF
Introduction to Circuits and Electricity
ssuser5feb2c1
 
PDF
counting booklet Elementary, Prinary.pdf
ssuser5feb2c1
 
PDF
number representation cards dfsdfsd df.pdf
ssuser5feb2c1
 
PPT
intro22.ppt intro22.ppt intro22.ppt intro22.ppt
ssuser5feb2c1
 
PPT
python.ppt python python python python python
ssuser5feb2c1
 
Introductory level to Arduino programming
ssuser5feb2c1
 
introduction to Dialogflow ES process.pptx
ssuser5feb2c1
 
Introduction to Circuits and Electricity
ssuser5feb2c1
 
counting booklet Elementary, Prinary.pdf
ssuser5feb2c1
 
number representation cards dfsdfsd df.pdf
ssuser5feb2c1
 
intro22.ppt intro22.ppt intro22.ppt intro22.ppt
ssuser5feb2c1
 
python.ppt python python python python python
ssuser5feb2c1
 
Ad

Recently uploaded (20)

PDF
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
PPTX
How to Manage Global Discount in Odoo 18 POS
Celine George
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PDF
Electricity-Magnetic-and-Heating-Effects 4th Chapter/8th-science-curiosity.pd...
Sandeep Swamy
 
PPTX
Strengthening open access through collaboration: building connections with OP...
Jisc
 
PPTX
vedic maths in python:unleasing ancient wisdom with modern code
mistrymuskan14
 
PDF
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
PPTX
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
PDF
Module 3: Health Systems Tutorial Slides S2 2025
Jonathan Hallett
 
PDF
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
PDF
Arihant Class 10 All in One Maths full pdf
sajal kumar
 
PPTX
Presentation on Janskhiya sthirata kosh.
Ms Usha Vadhel
 
PPTX
ACUTE NASOPHARYNGITIS. pptx
AneetaSharma15
 
PDF
Landforms and landscapes data surprise preview
jpinnuck
 
PDF
3.The-Rise-of-the-Marathas.pdfppt/pdf/8th class social science Exploring Soci...
Sandeep Swamy
 
PDF
High Ground Student Revision Booklet Preview
jpinnuck
 
PDF
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
PPTX
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
DOCX
UPPER GASTRO INTESTINAL DISORDER.docx
BANDITA PATRA
 
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
How to Manage Global Discount in Odoo 18 POS
Celine George
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
Electricity-Magnetic-and-Heating-Effects 4th Chapter/8th-science-curiosity.pd...
Sandeep Swamy
 
Strengthening open access through collaboration: building connections with OP...
Jisc
 
vedic maths in python:unleasing ancient wisdom with modern code
mistrymuskan14
 
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
Module 3: Health Systems Tutorial Slides S2 2025
Jonathan Hallett
 
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
Arihant Class 10 All in One Maths full pdf
sajal kumar
 
Presentation on Janskhiya sthirata kosh.
Ms Usha Vadhel
 
ACUTE NASOPHARYNGITIS. pptx
AneetaSharma15
 
Landforms and landscapes data surprise preview
jpinnuck
 
3.The-Rise-of-the-Marathas.pdfppt/pdf/8th class social science Exploring Soci...
Sandeep Swamy
 
High Ground Student Revision Booklet Preview
jpinnuck
 
UTS Health Student Promotional Representative_Position Description.pdf
Faculty of Health, University of Technology Sydney
 
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
UPPER GASTRO INTESTINAL DISORDER.docx
BANDITA PATRA
 

microbit Microbit programming Microbit programming

  • 3. FEATURES • The micro:bit board, an ARM-based development board • It is a very easy to use and includes a lot of peripherals • No need for soldering or use of external hardware to get started with • The processor is an nRF51 • It has 16 KB of RAM and 256 KB of FLASH
  • 4. FEATURES • The micro:bit has 19 GPIOs available as assignable. Up to 3 can be assigned as PWM pins and 6 as analog inputs. The ADC of the processor has a resolution of 10 bits • The GPIOs also have support for I2C, SPI and Serial communication interfaces • The board has a Freescale MKL26Z128VFM4 microcontroller, which is responsible for handling the USB connection between the micro:bit board and a computer, and also for the flashing of new code. • The micro:bit board is detected as a USB disk when connected to our computer
  • 6. FEATURES • The micro:bit board has several peripherals on board (I2C) • It has a Freescale MMA8653FC, a 3-axis accelerometer with a resolution of 10 bits. • It also has an on board Freescale MAG3110 magnetometer, which allows to get magnetic field strength measurements (I2C) • The nRF51 processor has an integrated temperature sensor with a resolution of, 0.25°C and an accuracy of +-4°C. • The board has 2 two buttons for user input. There is an additional button that allows to reset the system. • The micro:bit board also has a 5×5 LED matrix for display purposes • The micro:bit board has a 2.4 GHz transceiver, which allows it to support Bluetooth low energy to establish communication with other devices • Besides Bluetooth, the radio of the board also allows the use of the Nordic Gazell protocol, which is a proprietary protocol that allows communication between devices that support it. This protocol operates on the 2.4 GHz, like Bluetooth.
  • 7. PROGRAMMING ENVIRONMENTS • The micro:bit has many development environments available, some of them designed to make it easy for beginners to get started, as Microsoft’s MakeCode • This editor offers the possibility of simulating the code execution very easily. A model of the micro:bit board is located at the left side of the code editing window and by the click of a button testing starts • In terms of higher level languages, the micro:bit can be programmed in Java, Python or C
  • 8. MakeCode • https://www.dfrobot.com/product-1587.html • https://makecode.microbit.org/ • https://makecode.microbit.org/offline • https://makecode.microbit.org/projects/
  • 10. The micro:bit - a reactive system • There are different types of computing systems, to address different kinds of problems that arise in practice: transaction processing systems are used by banks to handle huge numbers of financial transactions by their customers; distributed systems make a set of networked computers appear as one big computer (like Google’s search engine); there are also parallel systems, such as graphic cards, which perform a huge number of primitive operations simultaneously, using a great number of small processing cores. • The micro:bit is a reactive system – it reacts continuously to external events, such as a person pressing the A button of the micro:bit or shaking the device. The reaction to an event may be to perform a computation, update variables, and change the display. After the device reacts to an event, it is ready to react to the next one. If this sounds like a computer game, that’s because most computer games are reactive systems too!
  • 11. The micro:bit - a reactive system • A responsive system is able to do several things at the same time. As the micro:bit only has one CPU it can only execute one program instruction at a time. • The micro:bit can execute millions of instructions per second, so it is possible for the device to alternate among instruction sequences of different programs. • Let’s think about three sequences of instructions: • Sequence S1: contains the instructions (let’s say several hundred thousand or so) that scroll the number 42 across the LED screen. • Sequence S2: contains a few instructions to check if button A is pressed. • Sequence S3: contains a few instructions to increment a counter. • The micro:bit interrupts the execution of sequence S1 periodically to execute the sequence S2, which will check if button A is pressed, which looks like:
  • 12. The micro:bit - a reactive system • The result is that it takes sequence S1 a little longer to complete, due to the interruptions to execute sequence S2, but we are checking often enough to detect a press of button A . When S2 detects a press of button A, then the sequence S3 can be executed before S1 resumes:
  • 25. EXAMPLES • Go to https://makecode.microbit.org/projects/ • Program examples • Flashing Heart • Name Tag • Rock Paper Scissors • Mood Radio • Fireflies • Go to https://www.dfrobot.com/product-1587.html • Program Microbit Project 13:
  • 28. MAQUEEN • Supply Voltage: 3.5V-5V DC ( Three AAA batteries or 3.6V~3.7V lithium battery ) • Infrared Grayscale Sensor(High-low level) x 2 • Buzzer x 1 • Infrared Receiver (NEC decoder) x 1 • LED Lights (High-low level control) x 2 • RGB Ambient Light (16 million colors) x 4 • SR04, SR04P Ultrasonic Interface(5V) x 1 • IIC Interface (3.3V) x 1
  • 29. MAQUEEN • Gravity Extension Interfaces (P1, P2) x 2 • N20 All-metal Gear Motor x 2 • Motor Reduction Ratio: 1:150 • Maximum Rotate Speed: 133 rpm • Motor Drive Mode: PWM motor drive • Bracket and Protective Cover Extension M3 Screw Hole x 6 • Programming Method: Makecode graphical programming, Mind graphical programming (based on Scratch 3.0) • Dimension: 81mm x 85 mm x 44mm/3.19 x 3.35 x 1.73in • Weight: 75.55g
  • 31. CONTINUATION ACTIVITIES • Download the “Terminal” at https://sites.google.com/site/terminalbpp/ • Practice the “Serial” commands • Use the online help or visit https://makecode.microbit.org/reference/serial • Practice the “Text” commands • Use the online help or visit https://makecode.microbit.org/reference/text • For the sensors “Temperature,” “Acceleration,” and “Compass,” write programs that send the read values to the computer. Try to make the sensor values change; consider using “pause.” • For the Acceleration, what is the meaning of the negative values? • For the Compass, is there any difference in the readings when the micro:bit is horizontal, compared to when it is vertical?
  • 32. CONTINUATION ACTIVITIES • This program requires the text terminated with CR+LF. On terminal v1.93 you do this as indicated in the figures below. Check both boxes.
  • 33. CONTINUATION ACTIVITIES • For the Maqueen • Write a program that measure distance and send to the screen • Study the object avoidance example • Study the line-following example, write your own version.
  • 34. CONTINUATION ACTIVITIES • This program reads the distance from the ultrasonic sensor and sends the value to the UART
  • 35. SENDING TEXT OVER BLUETOOTH
  • 36. SENDING TEXT OVER BLUETOOTH • This functions receives “text”, a text argument • If the length of text exceeds the Bluetooth capacity, an “X” is shown, and the program gets locked • Else “text” is sent over Bluetooth
  • 37. SENDING TEXT OVER BLUETOOTH • This function rounds a number to two decimal places • The result is stored in “roundResult” as text, there is not any function to round decimal paces in MakeCode.
  • 38. SENDING TEXT OVER BLUETOOTH • This program calculates the square root of a sequence of numbers • “on start” initializes Bluetooth and the first number to obtain the square root • Show index is used to provide feedback to the user