Тёмный

How to make a dice 🎲 on your Microbit project tutorial  

Electronics Loop
Подписаться 833
Просмотров 31 тыс.
50% 1

In this video we’re making an electronic dice using the makecode microbit editor. We would expect this easy microbit project to take you 5 minutes or less to complete. Link below to our shared code project download.
Roll your micro:bit dice three times and comment your total score below.
The microbit has everything needed, a display to show the dice markings and a shake event. We’re going to start off showing numbers ( mild chilli challenge 🌶 ) then we will expand on this to replicate and show electronic dice faces ( spicy chilli challenge 🌶🌶 ).
You can grab the finished project here which we have shared on microbit.org
code: makecode.micro...
Showing the numbers is straight forward. The trouble is that the output does not really represent a dice so we then move on to expand the code and show the corresponding dice face. Points to look out for are ensuring that we load the dice face image array on startup, without this you’ll end up with an error when shaking the dice. You’ll also notice that because the first element of the list is indexed at zero our random number range changes from 1-6 to 0-5. Don’t forget when working on your own code to pause for thought on how to correctly index your own arrays and lists.
We test out the code using the on screen simulator and then load it onto a real micro:bit device for a hands on test.
Hot chilli challenge 🌶🌶🌶 can you improve on this code… perhaps add an animation to show the dice ‘rolling’ or why not link in the buttons or add a message on the display to guide a user on how to roll the micro:bit dice.
What Microbit project would you like to see us make next? Comment down below.
Giving the video a thumbs up and sharing it motivates us to make more videos like this for you to enjoy. If this is the first video you’ve seen on our channel then subscribe and turn on notifications to ensure you don’t miss our next upload.
How to make a dice 🎲 on your Microbit #microbitcoding #microbit #microbitproject micro:bit coding example project.

Наука

Опубликовано:

 

8 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 39   
@Vladahq
@Vladahq 3 года назад
This saved me thanks
@ElectronicsLoop
@ElectronicsLoop 3 года назад
Awesome! Pleased you found it useful.
@ElectronicsLoop
@ElectronicsLoop 5 лет назад
Download the project code here: makecode.microbit.org/_XyYhhxcaqHE5 On three rolls of the dice we scored: 3 + 4 + 2 = 9. Did you beat our score? Comment your own score below.
@liskrasniqi3728
@liskrasniqi3728 3 года назад
I tried this and it was useful but I wanted to ask if it makes that sound or you puted it when you edited the video
@ElectronicsLoop
@ElectronicsLoop 3 года назад
Thanks for your comment. The sound was added as an effect in the edit. The micro:bit v2 has a built in speaker so this could generate the dice sounds.
@did7991
@did7991 3 года назад
Thank you for helping me with my hw! 👍
@ElectronicsLoop
@ElectronicsLoop 3 года назад
Awesome, we are pleased the video helped out :)
@meganntang
@meganntang 4 года назад
THANK YOU SO MUCH oop caps but thanks! now my board game is complete!
@ElectronicsLoop
@ElectronicsLoop 4 года назад
We are pleased you enjoyed and have made a dice for your board games... we hope you win the games. Good Luck!
@meganntang
@meganntang 4 года назад
@@ElectronicsLoop Aww tysm!
@gonewithwind3146
@gonewithwind3146 3 года назад
Is the sound of dice also programmed? Tks
@ElectronicsLoop
@ElectronicsLoop 3 года назад
It's a video edit. The micro:bit v2 has a speaker so sound could be added on that one.
@swenty7962
@swenty7962 3 года назад
My hw is done. Thanks for the help
@ElectronicsLoop
@ElectronicsLoop 3 года назад
Awesome news. Pleased the video help you. Keep learning and best wishes. If there is any more topics let us know and we'll see if we can make a video.
@Muinul-o7l
@Muinul-o7l 2 года назад
Woww
@ElectronicsLoop
@ElectronicsLoop 2 года назад
Thank You!
@dario9256
@dario9256 3 года назад
Thank you very much dude
@ElectronicsLoop
@ElectronicsLoop 3 года назад
Thank you so much for your comment, we're pleased you found the video useful.
@haiinibuhao.forreal
@haiinibuhao.forreal 3 года назад
but can u show me how to make the probability of showing number 6 higher?
@SuperJenny520
@SuperJenny520 2 года назад
yeah , i did it
@ElectronicsLoop
@ElectronicsLoop 2 года назад
Awesome... that is great to hear. Pleased you found the video helpful.
@SuperJenny520
@SuperJenny520 2 года назад
@@ElectronicsLoop thanks so much , it really useful for me
@rodney3933
@rodney3933 3 года назад
It was fun! I am a picky person. It was easy
@ElectronicsLoop
@ElectronicsLoop 3 года назад
Awesome :) thank you for your comment. We’re pleased you enjoyed the video
@MarcAemisegger
@MarcAemisegger 3 года назад
what is the sound for roll the dice?
@ElectronicsLoop
@ElectronicsLoop 3 года назад
Hey, thanks for your comment :) The dice roll was added in the video edit. However, check out Microbit V2 which has a built in speaker so you could include the dice roll on-device :)
@nileshsingh681
@nileshsingh681 3 года назад
Very useful
@ElectronicsLoop
@ElectronicsLoop 3 года назад
Thank you :)
@KarimMohamed-r2q
@KarimMohamed-r2q 8 месяцев назад
my micro:bit not doing this can you send to us the code on the chat box here👇🏾
@MacAndCheeseMan8764
@MacAndCheeseMan8764 3 года назад
My hw is complete!
@ElectronicsLoop
@ElectronicsLoop 3 года назад
Awesome, we are pleased the video helped out :)
@nileshsingh681
@nileshsingh681 3 года назад
There is also a different way to make a dice program
@ElectronicsLoop
@ElectronicsLoop 3 года назад
We would love to hear your idea :)
@oreopeed
@oreopeed 3 года назад
still don't understand ;-; oof
@nileshsingh681
@nileshsingh681 3 года назад
Very useful
@morilina
@morilina 4 года назад
BOO!!!!
@ElectronicsLoop
@ElectronicsLoop 4 года назад
Hehe Booooooooo!
@我是全滿德
@我是全滿德 3 года назад
YA
Далее
小丑家的感情危机!#小丑#天使#家庭
00:15
Using the accelerometer on the micro:bit
17:15
Просмотров 2,3 тыс.
10 ideas for a micro:bit robot
5:54
Просмотров 54 тыс.
micro:bit V2 - The new BBC micro:bit - Hands on
11:57
Unboxing the New Micro:bit V2!
8:00
Просмотров 11 тыс.
Micro:bit Automatic Plant Watering System
5:50
Просмотров 119 тыс.
iPad Turned Into Car Touchscreen (Via: @biggibril)
0:11
Вот так обновление #айфон #ios18
0:40
Cómo pensaba que sería el iPhone 16 😭
0:12
Просмотров 2,5 млн
Кому новенький айфон
0:19
Просмотров 2,1 млн