Search found 17 matches

by lujo
Fri Jul 17, 2020 7:08 am
Forum: micro:bit boards
Topic: from machine import Pin
Replies: 3
Views: 309

Re: from machine import Pin

Hi, MicroPython v1.9.2-34-gd64154c73 on 2017-09-01; micro:bit v1.0.1 with nRF51822 Type "help()" for more information. >>> >>> import microbit >>> [p for p in dir(microbit) if p.startswith('pin')] ['pin0', 'pin1', 'pin2', 'pin3', 'pin4', 'pin5', 'pin6', 'pin7', 'pin8', 'pin9', 'pin10', 'pin11', 'pin...
by lujo
Thu Jun 11, 2020 8:45 am
Forum: micro:bit boards
Topic: GPIO pin dafault settings
Replies: 3
Views: 272

Re: GPIO pin dafault settings

Hi,

9 pins for GPIO input/output, NO_PULL, PULL_UP, PULL_DOWN,
8 pins control display and buttons (display.on(), display.off()),
2 pins for I2C (accelerometer and compass).

If 9 pins won't do, get a second micro:bit and use the radio
to control the first, get its data and show its messages.
by lujo
Mon Dec 30, 2019 10:24 am
Forum: micro:bit boards
Topic: [SOLVED] Can't obtain repl over USB using screen on micro:bit
Replies: 10
Views: 1673

Re: Can't obtain repl over USB using screen on micro:bit

Hi, Get a list of your micro:bit serial addresses: #!/usr/bin/python3 from serial.tools.list_ports import comports as serial_ports def find_microbits(): lst = [] for port in serial_ports(): if "VID:PID=0D28:0204" in port.hwid: lst.append(port.device) return lst ports = find_microbits() if ports: pri...
by lujo
Fri Dec 27, 2019 12:28 am
Forum: micro:bit boards
Topic: [SOLVED] Can't obtain repl over USB using screen on micro:bit
Replies: 10
Views: 1673

Re: Can't obtain repl over USB using screen on micro:bit

Hi, Or MicroPython has been overwritten (with a Microsoft MakeCode program or something like that). Plug in the micro:bit, wait until your PC has detected the microbit, you now have a device file. Start the mu-editor. Click New, then click Flash. This will install the MicroPython runtime. Click REPL...
by lujo
Thu Dec 26, 2019 10:51 pm
Forum: micro:bit boards
Topic: [SOLVED] Can't obtain repl over USB using screen on micro:bit
Replies: 10
Views: 1673

Re: Can't obtain repl over USB using screen on micro:bit

Hi,

Maybe there is a program running. Hit Ctrl-C few times.

lujo
by lujo
Thu Dec 26, 2019 10:45 pm
Forum: micro:bit boards
Topic: [SOLVED] Can't obtain repl over USB using screen on micro:bit
Replies: 10
Views: 1673

Re: Can't obtain repl over USB using screen on micro:bit

Hi,

Works for me. So, what micro USB cable are you using, power only
or power plus data micro USB cable?

lujo
by lujo
Sat Dec 07, 2019 1:44 am
Forum: micro:bit boards
Topic: pin digital_read
Replies: 9
Views: 1763

Re: pin digital_read

Hi, There is a pulse in function. Source is here: https://github.com/bbcmicrobit/micropython/blob/e10a5ffdbaf1cc40a82a665d79343c7b6b78d13b/source/extmod/machine_pulse.c from microbit import * from utime import sleep_us from machine import time_pulse_us def sonar( ): pin0.write_digital(0) sleep_us(10...
by lujo
Fri Dec 06, 2019 8:31 am
Forum: micro:bit boards
Topic: pin digital_read
Replies: 9
Views: 1763

Re: pin digital_read

Hi, Did you really used the same pin for triggering and reading back the echo? If I use two different micro:bit pins, it works. Using your code to start with: from microbit import * from utime import ticks_us, sleep_us, ticks_diff def sonar( ): pin0.write_digital(0) sleep_us(10) pin0.write_digital(1...