MicroPython

Sun, 04 Apr 2021 16:56:31 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 04 Apr 2021 16:56:31 +0200
changeset 8200
5a5e9db1f608
parent 8199
f6db89b067e7
child 8201
a1149b1b4456

MicroPython
- updated the BBC micro:bit API file to support micro:bit V2

docs/changelog file | annotate | diff | comparison | revisions
eric6/APIs/MicroPython/microbit.api file | annotate | diff | comparison | revisions
--- a/docs/changelog	Sat Apr 03 16:54:10 2021 +0200
+++ b/docs/changelog	Sun Apr 04 16:56:31 2021 +0200
@@ -8,6 +8,7 @@
      message code
 - MicroPython
   -- added option to select the baud rate for flashing ESP32 and ESP8266 boards
+  -- updated the BBC micro:bit API file to support micro:bit V2
 
 Version 21.4:
 - bug fixes
--- a/eric6/APIs/MicroPython/microbit.api	Sat Apr 03 16:54:10 2021 +0200
+++ b/eric6/APIs/MicroPython/microbit.api	Sun Apr 04 16:56:31 2021 +0200
@@ -8,6 +8,9 @@
 machine.reset?4()
 machine.time_pulse_us?4(pin, pulse_level, timeout_us=1000000)
 machine.unique_id?4()
+microbit.Button.get_presses?4()
+microbit.Button.is_pressed?4()
+microbit.Button.was_pressed?4()
 microbit.Image.ANGRY?7
 microbit.Image.ARROW_E?7
 microbit.Image.ARROW_N?7
@@ -88,6 +91,7 @@
 microbit.MicroBitAnalogDigitalPin.NO_PULL?7
 microbit.MicroBitAnalogDigitalPin.PULL_DOWN?7
 microbit.MicroBitAnalogDigitalPin.PULL_UP?7
+microbit.MicroBitAnalogDigitalPin.get_analog_period_microseconds?4()
 microbit.MicroBitAnalogDigitalPin.get_mode?4()
 microbit.MicroBitAnalogDigitalPin.get_pull?4()
 microbit.MicroBitAnalogDigitalPin.read_analog?4()
@@ -97,9 +101,6 @@
 microbit.MicroBitAnalogDigitalPin.set_pull?4(mode)
 microbit.MicroBitAnalogDigitalPin.write_analog?4(value)
 microbit.MicroBitAnalogDigitalPin.write_digital?4(value)
-microbit.MicroBitButton.get_presses?4()
-microbit.MicroBitButton.is_pressed?4()
-microbit.MicroBitButton.was_pressed?4()
 microbit.MicroBitDigitalPin.NO_PULL?7
 microbit.MicroBitDigitalPin.PULL_DOWN?7
 microbit.MicroBitDigitalPin.PULL_UP?7
@@ -112,9 +113,16 @@
 microbit.MicroBitDigitalPin.set_pull?4(mode)
 microbit.MicroBitDigitalPin.write_analog?4(value)
 microbit.MicroBitDigitalPin.write_digital?4(value)
+microbit.MicroBitTouchOnlyPin.CAPACITIVE?7
+microbit.MicroBitTouchOnlyPin.RESISTIVE?7
+microbit.MicroBitTouchOnlyPin.is_touched?4()
+microbit.MicroBitTouchOnlyPin.set_touch_mode?4(mode)
+microbit.MicroBitTouchPin.CAPACITIVE?7
 microbit.MicroBitTouchPin.NO_PULL?7
 microbit.MicroBitTouchPin.PULL_DOWN?7
 microbit.MicroBitTouchPin.PULL_UP?7
+microbit.MicroBitTouchPin.RESISTIVE?7
+microbit.MicroBitTouchPin.get_analog_period_microseconds?4()
 microbit.MicroBitTouchPin.get_mode?4()
 microbit.MicroBitTouchPin.get_pull?4()
 microbit.MicroBitTouchPin.is_touched?4()
@@ -123,8 +131,21 @@
 microbit.MicroBitTouchPin.set_analog_period?4(period)
 microbit.MicroBitTouchPin.set_analog_period_microseconds?4(period)
 microbit.MicroBitTouchPin.set_pull?4(mode)
+microbit.MicroBitTouchPin.set_touch_mode?4(mode)
 microbit.MicroBitTouchPin.write_analog?4(value)
 microbit.MicroBitTouchPin.write_digital?4(value)
+microbit.Sound.GIGGLE?7
+microbit.Sound.HAPPY?7
+microbit.Sound.HELLO?7
+microbit.Sound.MYSTERIOUS?7
+microbit.Sound.SAD?7
+microbit.Sound.SLIDE?7
+microbit.Sound.SOARING?7
+microbit.Sound.SPRING?7
+microbit.Sound.TWINKLE?7
+microbit.Sound.YAWN?7
+microbit.SoundEvent.LOUD?7
+microbit.SoundEvent.QUIET?7
 microbit.accelerometer.current_gesture?4()
 microbit.accelerometer.get_gestures?4()
 microbit.accelerometer.get_values?4()
@@ -157,6 +178,12 @@
 microbit.i2c.read?4(addr, n, repeat=False)
 microbit.i2c.scan?4()
 microbit.i2c.write?4(addr, buf, repeat=False)
+microbit.microphone.current_event?4()
+microbit.microphone.get_events?4()
+microbit.microphone.is_event?4(event)
+microbit.microphone.set_threshold?4(event, value)
+microbit.microphone.sound_level?4()
+microbit.microphone.was_event?4(event)
 microbit.panic?4(code)
 microbit.pin0?7
 microbit.pin10?7
@@ -177,9 +204,14 @@
 microbit.pin7?7
 microbit.pin8?7
 microbit.pin9?7
+microbit.pin_logo?7
+microbit.pin_speaker?7
 microbit.reset?4()
 microbit.running_time?4()
+microbit.set_volume?4(volume)
 microbit.sleep?4(ms)
+microbit.speaker.off?4()
+microbit.speaker.on?4()
 microbit.spi.init?4(baudrate=1000000, bits=8, mode=0, sclk=pin13, mosi=pin15, miso=pin14)
 microbit.spi.read?4(nbytes)
 microbit.spi.write?4(buffer)
@@ -234,8 +266,10 @@
 music.set_tempo?4(ticks=4, bpm=120)
 music.stop?4(pin=microbit.pin0)
 neopixel.NeoPixel.clear?4()
+neopixel.NeoPixel.fill?4(color)
 neopixel.NeoPixel.show?4()
-neopixel.NeoPixel?1(pin, n)
+neopixel.NeoPixel.write?4()
+neopixel.NeoPixel?1(pin, n, bpp=3)
 os.listdir?4()
 os.remove?4(filename)
 os.size?4(filename)
@@ -262,9 +296,9 @@
 random.randrange?4(stop)
 random.seed?4(n)
 random.uniform?4(a, b)
-speech.pronounce?4(phonemes, *, pitch=64, speed=72, mouth=128, throat=128)
-speech.say?4(words, *, pitch=64, speed=72, mouth=128, throat=128)
-speech.sing?4(phonemes, *, pitch=64, speed=72, mouth=128, throat=128)
+speech.pronounce?4(phonemes, *, pitch=64, speed=72, mouth=128, throat=128, pin=pin0)
+speech.say?4(words, *, pitch=64, speed=72, mouth=128, throat=128, pin=pin0)
+speech.sing?4(phonemes, *, pitch=64, speed=72, mouth=128, throat=128, pin=pin0)
 speech.translate?4(words)
 utime.sleep?4(seconds)
 utime.sleep_ms?4(ms)

eric ide

mercurial