Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
# Conflicts:
#	docs/pin.rst
  • Loading branch information
MinoruInachi committed Nov 28, 2021
2 parents aac435e + 3148254 commit a17822d
Show file tree
Hide file tree
Showing 29 changed files with 912 additions and 256 deletions.
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@ FORCE:
.PHONY: FORCE

$(HEX_FINAL): yotta $(VER_ADDR_FILE)
tools/adduicr.py $(HEX_SRC) $$(cat $(VER_ADDR_FILE)) -o $(HEX_FINAL)
@size $(HEX_SRC:.hex=)
tools/adduicr.py $(HEX_SRC) 0x$$(cat $(VER_ADDR_FILE)) -o $(HEX_FINAL)
@arm-none-eabi-size $(HEX_SRC:.hex=)

yotta: $(MBIT_VER_FILE)
@yt build
@yotta build

$(MBIT_VER_FILE): FORCE
python tools/makeversionhdr.py $(MBIT_VER_FILE)

$(VER_ADDR_FILE): yotta
@echo -n "0x" > $(VER_ADDR_FILE)
@objdump -x $(HEX_SRC:.hex=) | grep microbit_version_string | cut -f 1 -d' ' >> $(VER_ADDR_FILE)
@arm-none-eabi-objdump -x $(HEX_SRC:.hex=) | grep microbit_version_string | cut -f 1 -d' ' > $(VER_ADDR_FILE)

deploy: $(HEX_FINAL)
$(ECHO) "Deploying $<"
Expand Down
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,29 @@ with an ARM compiler toolchain (eg arm-none-eabi-gcc and friends).
Ubuntu users can install the needed packages using:
```
sudo add-apt-repository -y ppa:team-gcc-arm-embedded
sudo add-apt-repository -y ppa:pmiller-opensource/ppa
sudo apt-get update
sudo apt-get install cmake ninja-build gcc-arm-none-eabi srecord libssl-dev
pip3 install yotta
sudo apt-get install gcc-arm-embedded
sudo apt-get install cmake ninja-build srecord libssl-dev
sudo -H pip3 install yotta
```

Once all packages are installed, use yotta and the provided Makefile to build.
Once all packages are installed run
`git clone https://github.com/bbcmicrobit/micropython` to get the source code.
The move to the created directory and use yotta and the provided Makefile to build.
You might need need an Arm Mbed account to complete some of the yotta commands,
if so, you could be prompted to create one as a part of the process.

- Use target bbc-microbit-classic-gcc-nosd:
- Use target [bbc-microbit-classic-gcc-nosd](https://github.com/lancaster-university/yotta-target-bbc-microbit-classic-gcc-nosd)
from GitHub (the yotta registry is deprecated as of 2021):

```
yt target bbc-microbit-classic-gcc-nosd
yotta target bbc-microbit-classic-gcc-nosd@https://github.com/lancaster-university/yotta-target-bbc-microbit-classic-gcc-nosd
```

- Run yotta update to fetch remote assets:

```
yt up
yotta up
```

- Start the build:
Expand Down
12 changes: 12 additions & 0 deletions docs/accelerometer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ Functions
By default the accelerometer is configured with a range of +/- 2g, and so
X, Y, and Z will be within the range of +/-2000mg.

.. py:function:: get_strength()
Get the acceleration measurement of all axes combined, as a positive
integer. This is the Pythagorean sum of the X, Y and Z axes, with the
measurement given in milli-g.

.. py:function:: current_gesture()
Return the name of the current gesture.
Expand Down Expand Up @@ -75,6 +81,12 @@ Functions
calls to some accelerometer method to do the gesture detection. Usually
gestures can be detected using a loop with a small :func:`microbit.sleep` delay.

.. py:function:: set_range(value)
Set the accelerometer sensitivity range, in g (standard gravity), to the
closest values supported by the hardware, so it rounds to either ``1``,
``2``, ``4``, or ``8`` g.

Examples
--------

Expand Down
19 changes: 13 additions & 6 deletions docs/devguide/flashfirmware.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ Use yotta to build.

Use target bbc-microbit-classic-gcc-nosd::

yt target bbc-microbit-classic-gcc-nosd
yotta target bbc-microbit-classic-gcc-nosd

Run yotta update to fetch remote assets::

yt up
yotta up

Start the build with either yotta::

yt build
yotta build

...or use the Makefile::

Expand All @@ -36,15 +36,22 @@ targets.
Preparing firmware and a Python program
---------------------------------------

tools/makecombined

hexlify
A script in the following location, called using the following syntax, should
help::

tools/makecombinedhex.py <firmware.hex> <script.py> [-o <combined.hex>]

The script will output to ``stdout`` if no output option (``-o``) is provided.

Flashing to the micro:bit
-------------------------

The Microbit mounts itself as a mass storage device over USB. When it detects
that a .hex file has been uploaded to the internal mass storage device, it will
flash itself with the bytecode representation, and start running the program.

This means that uploading a .hex file should result in the Microbit running your
code.



Expand Down
20 changes: 16 additions & 4 deletions docs/devguide/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ When installing `Yotta
OS X
~~~~

After cloning the repository, install yotta using the app and launch the app.
You can find the latest release of yotta for OS X at
`<https://github.com/ARMmbed/yotta_osx_installer/releases/>`_ .


.. _microbit-linux:

Expand All @@ -75,14 +79,22 @@ Debian/Ubuntu, and Red Hat Fedora/Centos.
Debian and Ubuntu
^^^^^^^^^^^^^^^^^

::
The following commands should install the toolchain on a modern Debian/Ubuntu
variant::

sudo add-apt-repository -y ppa:team-gcc-arm-embedded
sudo add-apt-repository -y ppa:pmiller-opensource/ppa
sudo apt-get update
sudo apt-get install cmake ninja-build gcc-arm-none-eabi srecord libssl-dev
pip3 install yotta
sudo apt-get install gcc-arm-embedded
sudo apt-get install cmake ninja-build srecord libssl-dev
sudo -H pip3 install yotta

In order to make development life a bit easier, you can (on Ubuntu) add yourself
to the ``dialout`` group, which grants write access to the serial device
``/dev/ttyACM0``::

sudo usermod -a -G dialout ${USER}

You may need to relogin in order for the changes to groups to take effect.

.. _microbit-redhat:

Expand Down
1 change: 1 addition & 0 deletions docs/image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ represents):
* ``Image.SKULL``
* ``Image.UMBRELLA``
* ``Image.SNAKE``
* ``Image.SCISSORS``

Finally, related collections of images have been grouped together::

Expand Down
40 changes: 29 additions & 11 deletions docs/locale/ja/LC_MESSAGES/accelerometer.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# Copyright (C) 2015-2016, Multiple authors
# This file is distributed under the same license as the BBC micro:bit
# MicroPython package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2017.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2021.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: BBC micro:bit MicroPython 0.5.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-10-09 10:10+0900\n"
"PO-Revision-Date: 2018-10-30 19:32+0900\n"
"POT-Creation-Date: 2021-11-28 11:29+0900\n"
"PO-Revision-Date: 2021-11-28 11:32+0900\n"
"Last-Translator: Minoru Inachi\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
Expand Down Expand Up @@ -95,10 +95,19 @@ msgstr ""
"設定されているため、X, Y, Z は +/- 2000mg の範囲内になります。"

#: ../../accelerometer.rst:49
msgid ""
"Get the acceleration measurement of all axes combined, as a positive "
"integer. This is the Pythagorean sum of the X, Y and Z axes, with the "
"measurement given in milli-g."
msgstr ""
"すべての軸を組み合わせた加速度の測定値を正の整数で取得します。"
"これは、X、Y、Z軸のピタゴラス和で、測定値はミリg単位で与えられます。"

#: ../../accelerometer.rst:55
msgid "Return the name of the current gesture."
msgstr "現在のジェスチャーの名前を返します。"

#: ../../accelerometer.rst:53
#: ../../accelerometer.rst:59
msgid ""
"MicroPython understands the following gesture names: ``\"up\"``, "
"``\"down\"``, ``\"left\"``, ``\"right\"``, ``\"face up\"``, ``\"face "
Expand All @@ -109,27 +118,27 @@ msgstr ""
"``\"right\"``, ``\"face up\"``, ``\"face down\"``, ``\"freefall\"``, "
"``\"3g\"``, ``\"6g\"``, ``\"8g\"``, ``\"shake\"`` 。ジェスチャーは常に文字列で表されます。"

#: ../../accelerometer.rst:60
#: ../../accelerometer.rst:66
msgid "Return True or False to indicate if the named gesture is currently active."
msgstr "指定した名前のジェスチャーが認識されているかにより True または False を返します。"

#: ../../accelerometer.rst:64
#: ../../accelerometer.rst:70
msgid ""
"Return True or False to indicate if the named gesture was active since "
"the last call."
msgstr ""
"前回の呼出し以降に指定した名前のジェスチャーが認識されたかにより True "
"または False を返します。"

#: ../../accelerometer.rst:69
#: ../../accelerometer.rst:75
msgid ""
"Return a tuple of the gesture history. The most recent is listed last. "
"Also clears the gesture history before returning."
msgstr ""
"ジェスチャーの履歴をタプルで返します。タプルは古い順に並び、最新のものが最後の要素に"
"なります。この呼出しを行うとジェスチャーの履歴はクリアされます。"

#: ../../accelerometer.rst:64
#: ../../accelerometer.rst:80
msgid ""
"Gestures are not updated in the background so there needs to be constant "
"calls to some accelerometer method to do the gesture detection. Usually "
Expand All @@ -139,11 +148,20 @@ msgstr ""
"何らかの加速度センサーのメソッドを常に呼び出す必要があります。通常、ジェスチャーは "
":func:`microbit.sleep` による小さな遅延のあるループを使って検出できます。"

#: ../../accelerometer.rst:79
#: ../../accelerometer.rst:86
msgid ""
"Set the accelerometer sensitivity range, in g (standard gravity), to the "
"closest values supported by the hardware, so it rounds to either ``1``, "
"``2``, ``4``, or ``8`` g."
msgstr ""
"加速度センサーの感度の範囲を g (標準重力)で設定し、ハードウェアがサポートする最も近い値、"
"つまり ``1``, ``2``, ``4``, or ``8`` g のいずれかに丸めます。"

#: ../../accelerometer.rst:91
msgid "Examples"
msgstr "サンプルコード"

#: ../../accelerometer.rst:81
#: ../../accelerometer.rst:93
msgid ""
"A fortune telling magic 8-ball. Ask a question then shake the device for "
"an answer."
Expand Down Expand Up @@ -230,7 +248,7 @@ msgstr ""
" display.scroll(random.choice(answers))\n"
" sleep(10)"

#: ../../accelerometer.rst:71
#: ../../accelerometer.rst:99
msgid "Simple Slalom. Move the device to avoid the obstacles."
msgstr "単純なスラロームです。デバイスを動かして障害物を避けてください。"

Expand Down

0 comments on commit a17822d

Please sign in to comment.