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
2 answers

Micro:bit - Accelerometer - (Micro python) make microbit count downward movements - only works with gestures

The following code works just fine: # Add your Python code here. E.g. from microbit import * score = 0 display.show(str(score)) while True: if accelerometer.was_gesture('face down'): score += 1 if score < 10: …
Mikkel
  • 33
  • 2
0
votes
1 answer

Syntax error while coding on mu with microbit

Here is the code i used to create an Edice for microbit: from microbit import * import random image1 = Image("00000:" "00000:" "00900:" "00000:" "00000") image2 = Image("90000:" …
Dan Ang
  • 13
  • 2
0
votes
2 answers

Problem with simple count variable in Python

I made this short code for a school project using a Microbit computer, however, when I press the a button when the count is 1, the count jumps to 16 and I can't figure out why. count = (1) while True: gesture = accelerometer.current_gesture() …
Lucas R
  • 11
0
votes
1 answer

String.fromCharCode() with only JS standard functions?

I am working on the Micro:bit. (Well, technically not homework, and I am not asking about the full solution). It can either use a really clunky graphical programming interface, or use a stripped down version of JS. No library importing and/or using…
he77789
  • 101
  • 4
0
votes
1 answer

Code formatting, basic temperature application

I am trying to create a basic code that will show the temperature on a BBC:microbit and then based on the temperature shown, after a button press different images will show on the screen. After a shake the micro:bit will show the current temperature…
rafipin
  • 3
  • 3
0
votes
0 answers

in microbit how to make variable save?

i want make reading variable led in a button and b. and button c(a+b) show variable led. if i push the button a b b a than show the led a b b a but can only show when i push the last button so help me how to make? (Button.AB, function () { …
0
votes
1 answer

How do I round to 1 decimal on the bbc:microbit with javascript w/o toFixed(), the usual multiplication + divide gives trailing 9999 digits?

temperatureReading = Math.round(temperatureReading * 10) / 10 gives me 26.29999999999999999999 instead of 26.3 And 26.00000000001 instead of 26.0 I get alternating 2 values from the temperature sensor: 26.33 and 26.3200000 After the conversion I…
monok
  • 494
  • 5
  • 16
0
votes
1 answer

How do I declare a TypeScript variable as volatile?

I am working with the BBC Micro Bit and am creating an extension for Make Code in TypeScript. I have the following event that gets triggered by a wheel encoder on my robot. Inside the event, I increment a couple of variables. In the Arduino…
Trevor Shaw
  • 123
  • 1
  • 10
0
votes
0 answers

Microbit Python Neopixel RGBW

I'm trying to use an RGBW NeoPixel strip from my MicroBit and it works using CodeBlocks but I can't get access to the white pixel using MicroPython (https://python.microbit.org). It looks like the version of the neopixel module is an old version…
Jim Hudd
  • 47
  • 10
0
votes
1 answer

Why are my arrays only accepting the first digits in the both of them?

Using the BBC Micro bit. There are two buttons on the micro bit and in my code button A is for even numbers and button B is for negative numbers. The game runs fine if the numbers are only a 1 or a 0 anything else it ends the game and i'm not sure…
0
votes
1 answer

Type Error Microbit Rock Paper Sciccors Project

I have a type error but can't seem to fix it. from microbit import * import random import radio radio.on() randomnummer = 0 while True: if accelerometer.current_gesture("shake"): #geschud (feelsgoodman) randomnummer =…
0
votes
1 answer

Micro:Bit Button Press Delay

I am trying to make a simple game similar to snake (however the player does not get longer over time). The game is almost complete, however I have encountered a problem where the button presses that would normally change the direction that you are…
0
votes
1 answer

microbit file system with JavaScript

I'm trying to write to serial: input.onButtonPressed(Button.B, function () { basic.showNumber(1) serial.redirectToUSB() serial.writeLine("dit is een test1") let my_data = "output.txt" files.appendLine( my_data,…
user1405338
  • 179
  • 1
  • 5
  • 14
0
votes
1 answer

Python - micro:bit add a variable in a function

I am trying to add a variable 'ch' for a radio function in microbit, but always I compile I receive an error message. The idea is send any argument to ch to be incorporate in the radio config function. from microbit import * import…
0
votes
1 answer

Getting unexpected output from BBC MicroBit robot when moving forwards and then reverse

I’m using a Micro:Bit and Bit:Bot to do some simple things but am getting unexpected results from the Bit:Bot motor. Simply put, i’m trying to: move the Bit:Bot forward for 1 second (with a few Green Neopixels on) Stop motors (& clear all…
Tiny
  • 409
  • 2
  • 8
  • 20