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
1
vote
1 answer

How can I send MES events to a micro:bit from python over bluetooth

I am trying to send events from my Raspberry Pi Zero W to my micro:bit in Python code to control a Kitronik Servo:Lite board. I have proved the micro:bit can control the Servo:Lite board using the Kitronik sample code and the Kitronik android…
Colin Pickard
  • 45,724
  • 13
  • 98
  • 148
1
vote
1 answer

Problems with Micropython command time_pulse_us on Microbit

I would like to ask some help from you. I'm trying to connect a distance sensor to my microbit but when I use the command "time_pulse_us" it always gives -2 or -1. I read the documentation, I understand the meaning of those numbers but I think…
Johann
  • 65
  • 7
1
vote
1 answer

micro:bit not responding to AB button presses

So I used this micro:bit for a while and it never had a problem but for some reason one day I started it and it refused to respond to my A+B button presses even though I did not change the code in any way. Both pressing A and B work but not both of…
1
vote
1 answer

How do I make an "if" statement with serial data?

I am writing a python script that will gather data from a serial port. I am able to gather the data and when it comes out it says b'1' I want to make an if statement for if it comes out as b'1' then I want it to run a function. This is my…
1
vote
2 answers

micro:bit Python send radio Image

micro:bit wireless radio BLE using Python I want to send over radio a member of the Image collection (Image.HEART). I know how to send strings and a custom image but not a member of the Image collection. I want receiver's message_in string to be…
Playing with GAS
  • 565
  • 3
  • 10
  • 18
1
vote
2 answers

micro:bit & /dev/ttyACM*on GNU/Linux systems

I have micro:bit attached to my laptop on which running Xubuntu 18.04.4 LTS. After I attached micro:bit an icon appeares on XFCE4 Desktop which can to use to mount this device to /media/MyUserName/MICROBIT/ This way I can pair the device 'BBC…
Pal Csanyi
  • 101
  • 1
  • 9
1
vote
1 answer

microbit Python: When using time module, how to keep sleep() units in milliseconds?

In microbit muPython: sleep(ms), the units is milliseconds. However, if import time module and use sleep() then muPython uses time module’s sleep(s) which is units of full seconds. Coder must substitute time module’s sleep_ms(ms) to get units of…
Playing with GAS
  • 565
  • 3
  • 10
  • 18
1
vote
1 answer

Microbit not receiving serial data sent form computer

I am trying to send data from my MacBook via python to the USB port that my microbit is connected to. my python program transfers the data then by looking on the back of my microbit I see that right next to the USB port a little light is blinking…
1
vote
1 answer

Is there a way to test micropython code with two microbits?

I have to make this code so two microbits can interact with each other. But I can't test it since I only have one. Is there a way to test this code through some online website/plugin/something? Code: https://pastebin.com/N0FirrsD (This code will…
Nick
  • 51
  • 1
  • 5
1
vote
0 answers

Unable to read from accelerometer on BBC microbit with Rust

I am trying to write some programs on BBC:Microbit with Rust. The book for this microcontroller on rust is not finished yet so I am missing some point. Actually, I have some problems with I2C bus. there is the Rust crate microbit…
1
vote
2 answers

Split user input string into a list with every character

I'm trying to write a program for the micro:bit which displays text as morse code. I've looked at multiple websites and Stack Overflow posts for a way to split a string into characters. E.g. string = "hello" to chars = ["h","e","l","l","o"] I…
edapm
  • 45
  • 1
  • 9
1
vote
2 answers

MicroPython - Micro:bit | Grove - Ultrasonic Ranger | Create driver for module

I'm trying to translate the python code for Raspberry to MicroBit MicroPython for driving a Grove - Ultrasonic Ranger module with…
1
vote
2 answers

How to control speed for a water pump plugged in a BBC microbit using micropython

How to control speed for a water pump plugged in a BBC micro:bit using micropython? So far to control the water pump I can turn it on/off, here is my code: from microbit import * pin2.write_digital(1) sleep(1000) pin2.write_digital(0) How it is…
Abdullah
  • 21
  • 7
1
vote
1 answer

microbit serial communication splits text into lines

I am a beginner with the microbit and I have tried to copy some code from different tutorials/code examples. I am just trying to set up the serial communication between a computer and the microbit. My plan is to have the microbit just echo every…
1
vote
0 answers

Micobit sends serial data to computer only within an event?

I wanna send data from microbit to PC. All the connections work fine. However I find that data is only sent to the computer if the serial write function is written within an event, for example, I use Makecode, and the following two…
Herbert Ho
  • 99
  • 1
  • 3