Questions tagged [bbc-microbit]

The BBC micro:bit is a small but yet powerful learning computer for kids and grown ups.

The BBC micro:bit is a small but yet powerful learning computer for kids and grown ups.

https://microbit.org

170 questions
0
votes
1 answer

Error using the bbc-microbit v2 with a servo motor

I am having difficulty using a servo motor with the bbc-microbit v2. I am programming in MicroPython using Mu (1.1.0.alpha.2), and I have followed instructions and sample code from Microbit and Sparkfun. I keep getting a "ValueError: invalid period"…
SNW
  • 1
  • 1
0
votes
1 answer

I get AttributeError on micro:bit examples

I have been trying the micro:bit radio examples but I can't get them to work as explained in, for example, radio.send_string("Hello World") will show the following error AttributeError: 'module' object has no attribute 'send_string' However if I…
0
votes
1 answer

Microbit music / scroll output corrupting memory?

My son and I are trying to implement one of the fun-science.org microbit tutorials - building a "tug of war" game. Essentially, 10 presses on button A moves the sprite closer to that button and the same applies on button B. When you hit the edge…
David Fulton
  • 737
  • 7
  • 16
0
votes
0 answers

Yotta build results in CMake Deprecation Warning, cmake-policies OLD behaviours

I am trying to build the code that is already made as examples for the Micro:bit using the recommended yotta build but after following every step I am getting this error: yotta build info: generate for target: bbc-microbit-classic-gcc 0.2.3…
0
votes
3 answers

Python and compass data - algorithim?

Subject: Python using compass sensor input: Stuck on calculation I’m taking a compass reading in degrees named “start”, turning about 360 degrees and taking a reading “end.” I want to know delta between start and end. Not how many degrees turned,…
Playing with GAS
  • 565
  • 3
  • 10
  • 18
0
votes
1 answer

Micro:Bit Connected to Adeept Board Resets When USB Plugged In

I have a BBC Micro:Bit. It's plugged into the Adeept board, which has an I2c 1602 LCD display, Adeept joystick, and Adeept button module. I have to supply power to the board's USB port to run the LCD display. I made a website and want to be able to…
0
votes
1 answer

Light to go from value 0 to 255 then to 0 again

I'm working on a light puls code, i want the light to go from value dark (0) then increase to bright (255). I have been trying to use a "for" to get this to work but i am really unsure. The code starts with the light on 0, then i want to increase it…
darthlars
  • 13
  • 3
0
votes
1 answer

Is there any way to find the five character ID of the micro:bit in micropython?

This is how we get the device name using blocks But I need to find the way to code in micropython to find the same. I have tried the following: from microbit import * while True: basic.show_string(control.device_name()) But this throws an…
Itty Bit
  • 23
  • 4
0
votes
2 answers

How do I add multiple numerical values that I got from previous algorithms into an array to do some calculation in MU python editor for microbit?

I'm new to programming and I'm building an ultrasonic sensor to calculate the distance of an object from the microbit. I have written some codes to measure the distances 50 times in 1 sec, but since each measurements are slightly different, i want…
0
votes
2 answers

Where is the Micro:Bit TypeScript randint() Function Documented?

I am trying* to teach a class of high school students to transition from block coding to JavaScript (really Static TypeScript) on the Micro:Bit. The pickrandom block translates into a call to randint() I would have expected a call to Math.randint()…
Bob Brown
  • 1,463
  • 1
  • 12
  • 25
0
votes
2 answers

How do I connect microbit with BLE and listen for button press events?

11/28/2021 Edit : If you need to connect your microbit to your computer using Bluetooth Low Energy, and do stuff when the button is clicked. Jump straight and follow @ukBaz's answer below. Note: The solution will work perfectly on GNU/Linux, but…
0
votes
1 answer

How can I access the light sensor value when using bbc:microbit over bluetooth?

I am playing around with bbc:microbit using bluetooth web api to access the microbit service data (button event, led, magnetometer, ...). It looks like the light sensor information are not accessible from the javascript API. From the microbit…
Eturcim
  • 798
  • 8
  • 26
0
votes
1 answer

How to change icon on micro:bit LED matrix with input from serial port

First of all, I am not a dev at all, just trying to make things working as I want. Cannot understand this: From one side, this is my python script on Ubuntu PC which sending button inputs from Playstation 4 joystick to serial port of micro:bit…
stiw47
  • 55
  • 1
  • 10
0
votes
1 answer

Mapping specific bits in input bytes to specific bits in output word

Background: Given some input bytes B0, B1, B2, B3 and B4, I want to extract selected bits from these 5 bytes and generate an output word. For example, denoting the nth bit of Bi as Bi[n], I want to be able to write a mapping f : (B0, B1, B2, B3, B4)…
CH.
  • 556
  • 1
  • 5
  • 16
0
votes
3 answers

Can someone explain what is happening with this piece of micro python

Just started playing with a BBC micro:bit. One of the examples has this line of code flash = [Image().invert()*(i/9) for i in range(9, -1, -1)] It generates set of images. In trying to figure out what is going on I wrote this piece of code class…
user667522
  • 29
  • 4