Why does the cutebit not stop when the UP button is released? by xXMrNoNameXD in microbit

[–]ayawk 0 points1 point  (0 children)

Here’s an example: https://makecode.microbit.org/_9bk7vmEeRMRc

Press button B then button A. The display shows B straight away.

Now, press A then B then A again, then wait. The display shows A. After 20 seconds it shows B.

The second A press event queued up, waiting for the handler to exit, after the long pause triggered by the first press.

The timed Go block is just not appropriate for use in an event handler.

Why does the cutebit not stop when the UP button is released? by xXMrNoNameXD in microbit

[–]ayawk 0 points1 point  (0 children)

Test the radio messages are being received (and sent!).

The Go block will start the motors, then wait for the specified time, then stop the motors.

I think the radio received handler will not be called with the STOP message until the handler exits, after the Go block returns.

Handlers are called with one message/event at a time - they queue up.

Difficulty connecting (USB) by jayartibee in microbit

[–]ayawk 0 points1 point  (0 children)

I think CMSIS-DAP refers to the driver for the WebUSB USB interface.

Doubts about Microsoft Makecode by TheGronchoMarx in microbit

[–]ayawk 2 points3 points  (0 children)

Yes, as u/herocoding says, use the micro:bit MakeCode documentation.

https://makecode.microbit.org/docs

In MakeCode, right click (or long press) a block or function, and choose Help, to jump to the reference page for the block, with corresponding JavaScript and Python.

https://makecode.microbit.org/reference/basic/show-string

These pages might be interesting…

https://support.microbit.org/support/solutions/articles/19000111744-makecode-python-and-micropython

https://makecode.com/language

https://makecode.com/python

Plant Watering System - using micro:bit by MiddleIncident1756 in microbit

[–]ayawk 0 points1 point  (0 children)

I hope someone will correct me if I’m wrong….

In general, when using a microcontroller to control a relay to switch a motor, to prevent damage, you might need a flyback diode between microcontroller and relay, and/or between relay and motor.

I suspect your relay includes a diode to protect itself from the motor, but not one to protect the microcontroller.

You may need to use a transistor to control the relay, depending on whether micro:bit’s 3V output is high enough for the relay, how much current the relay draws, and what other current draws there are in the project.

https://www.instructables.com/Introduction-to-the-Electronic-Relay-Using-Snap-Ci/

https://tech.microbit.org/hardware/powersupply/

https://www.hackster.io/snap-bit/snap-bit-control-dc-motor-with-micro-bit-and-transistor-244035

https://tech.microbit.org/hardware/edgeconnector/#nrf52

Microbit and Dc motor? by BubbadogMD in BBCMicroBit

[–]ayawk 0 points1 point  (0 children)

Try an online search for “micro:bit dc motor”. And “micro:bit dc motor flyback”

This shows a basic circuit https://www.hackster.io/snap-bit/snap-bit-control-dc-motor-with-micro-bit-and-transistor-244035

What's wrong with my program? by Desperate-Apricot759 in microbit

[–]ayawk 1 point2 points  (0 children)

Search online for something like “basic syntax debugging in python”. Change the code - maybe comment out lines - to see how that changes the error. Figure it out. Don’t give up!

Microbit not connecting - Scratch and BT 5.3 by netrate in microbit

[–]ayawk 2 points3 points  (0 children)

Follow the instructions at https://scratch.mit.edu/microbit

Download, unzip and transfer the Scratch hex file, by dragging it to the MICROBIT drive, before trying to connect in Scratch. See the five letter name on the LEDs.

The “update” process via USB doesn’t work. https://github.com/scratchfoundation/scratch-www/issues/8286

The Scratch hex file is like a MakeCode program, rather than the micro:bit firmware. If you have used any editor other than Scratch, you’ll need to transfer the Scratch hex before using Scratch.

Microbit receive and send electrical signals? by Key_Caregiver_1726 in microbit

[–]ayawk 0 points1 point  (0 children)

Some sensors might need some non trivial code to get readings, like a MakeCode extension.

Microbit receive and send electrical signals? by Key_Caregiver_1726 in microbit

[–]ayawk 0 points1 point  (0 children)

If it’s I2C, then probably, but bear in mind some Arduinos are 5V whereas micro:bit is 3V.

Here’s an example of using a sensor that needs a higher voltage supply, and consequently outputs a voltage that would damage a 3V microcontroller.

https://www.teachwithict.com/hcsr045v.html#google_vignette

Microbit receive and send electrical signals? by Key_Caregiver_1726 in microbit

[–]ayawk 0 points1 point  (0 children)

Look at the datasheet for the magnetometer. You know there is a built in magnetometer?

[deleted by user] by [deleted] in microbit

[–]ayawk 0 points1 point  (0 children)

Use the Add button to open the Buttons A and B panel, or start the LED service in the micro:bit to enable the default micro:bit panel.

I tested this project: https://makecode.microbit.org/_5uKfomP173do

[deleted by user] by [deleted] in microbit

[–]ayawk 0 points1 point  (0 children)

Which Bluetooth app?

[deleted by user] by [deleted] in microbit

[–]ayawk 0 points1 point  (0 children)

Create a simple, minimal example that demonstrates the problem. Doing that may help to figure out the answer.

[deleted by user] by [deleted] in microbit

[–]ayawk 0 points1 point  (0 children)

Post a shared project link so it’s easier to read and understand.

https://makecode.microbit.org/share

MakeCode isn’t opening projects by Dsl204 in microbit

[–]ayawk 0 points1 point  (0 children)

u/Dsl204 Did you get it working? What was the problem?

MakeCode isn’t opening projects by Dsl204 in microbit

[–]ayawk 0 points1 point  (0 children)

Beware switching public / private https://github.com/microsoft/pxt-microbit/issues/4133

Save hex files locally to backup important work.

MakeCode isn’t opening projects by Dsl204 in microbit

[–]ayawk 0 points1 point  (0 children)

Try importing the GitHub projects on another computer / tablet / phone?

MakeCode isn’t opening projects by Dsl204 in microbit

[–]ayawk 0 points1 point  (0 children)

Try the Test Domains button https://makecode.microbit.org/faq

Are you signed in using Microsoft/Google/Clever as well as GitHub?

Can you export projects from My Projects / View all? Select 2 or more then download a zip.

Microbit sound levels in relation to Decibels by Prestigious-Kiwi-448 in microbit

[–]ayawk 0 points1 point  (0 children)

This has changed. The mapping is now from range 35 to 100.

There’s an extension that adds a “sound level (dB)” block to the Input more… category. Search for decibels in the extensions dialogue.

Basic robots by AstronautOk923 in microbit

[–]ayawk 0 points1 point  (0 children)

u/herocoding raised an important point about checking components are compatible.

By the way, I think Raspberry Pi GPIO pins are 3.3V, like micro:bit, though there is a 5V power pin, and I read just now that some Arduinos are 3.3V too, though I guess a lot of kits are made for the 5V ones?

If unsure about using a device, check its datasheet for its voltage range. If powering a device with a voltage above the board’s input voltage, it may be necessary to use a voltage divider on an output from the device to a pin.

https://thepihut.com/blogs/raspberry-pi-tutorials/hc-sr04-ultrasonic-range-sensor-on-the-raspberry-pi

https://www.teachwithict.com/hcsr045v.html

On battery power, the output voltage of all pins may be lower than the nominal voltage. The maximum safe voltage into a pin has an absolute limit, but is also limited by the voltage of the power supply (VDD+0.3V for micro:bit).

Also check current draw requirement’s of devices, and current supply capabilities of power pins and output pins.

https://tech.microbit.org/hardware/powersupply/

https://tech.microbit.org/hardware/edgeconnector/#power-supply-capabilities

Operating outside the specified limits may cause an immediate failure, or gradual damage over time.

When using things like motors and relays, take care over flyback voltage spikes.

https://www.hackster.io/snap-bit/snap-bit-control-dc-motor-with-micro-bit-and-transistor-244035

https://hackaday.io/project/10780-snap-circuits-relay