changeset 13:46a5abc02fd1 draft

Add readme
author Radomir Dopieralski <sheep-devel@sheep.art.pl>
date Fri, 23 Feb 2018 12:06:11 +0100
parents db363727e325
children 8239a9ade11d
files README.rst menu.py pew.py
diffstat 3 files changed, 55 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/README.rst	Fri Feb 23 12:06:11 2018 +0100
@@ -0,0 +1,50 @@
+CircuitPython LAMEBOY
+*********************
+
+This is a set of libraries for CircuitPython to make use of the Lameboy device.
+
+What is Lameboy? It's a small handheld device with buttons, screen and an
+ESP8266 microcontroller designed by Davedarko. For more information see:
+`https://hackaday.io/project/26823 <https://hackaday.io/project/26823>`_.
+
+
+Installation
+============
+
+First you need to flash CircuitPython onto the device. Get the `esptool.py
+<https://pypi.python.org/pypi/esptool>`_ utility, get the `CircyitPython
+image for the HUZZAH <https://github.com/adafruit/circuitpython/releases>`_,
+and flash it::
+
+    esptool.py --port /dev/ttyUSB0 erase_flash
+    esptool.py --port /dev/ttyUSB0 write_flash 0 adafruit-circuitpython-feather_huzzah-2.2.3.bin
+
+Verify it was successful by connecting to the REPL::
+
+    screen /dev/ttyUSB0 115200
+
+After you press ENTER a few times, you should see the Python prompt: `>>>`.
+
+Next, you need to get the `Ampy <https://pypi.python.org/pypi/adafruit-ampy>`_
+utility and use it to copy the files onto the device::
+
+    ampy --port /dev/ttyUSB0 put lameboy.py
+    ampy --port /dev/ttyUSB0 put pew.py
+
+Now you can import lameboy and use it to access the device's hardware.
+
+
+PewPew
+======
+
+The ``pew.py`` library is a compatibility layer for the `PewPew FeatherWing
+<https://hackaday.io/project/21578>`_ device. It lets you play the `games
+written for PewPew <https://github.com/pewpew-game/pewpew/tree/master/games>`_.
+
+Just copy the game files onto the device with ampy, and import them on the
+REPL. You can also use the ``menu.py`` program included in this repository to
+select which game to play. If you create a ``main.py`` file with just::
+
+    import menu
+
+in it, it will start automatically on the device power on.
--- a/menu.py	Thu Feb 22 23:02:43 2018 +0100
+++ b/menu.py	Fri Feb 23 12:06:11 2018 +0100
@@ -37,7 +37,7 @@
 
 
 def menu(entries):
-    brightness = 7
+    brightness = 0
     pew.brightness(brightness)
     selected = 0
     pix = pew.Pix.from_text(entries[selected])
--- a/pew.py	Thu Feb 22 23:02:43 2018 +0100
+++ b/pew.py	Fri Feb 23 12:06:11 2018 +0100
@@ -34,7 +34,10 @@
 
 
 def brightness(level):
-    pass
+    try:
+        lameboy.backlight.color(level * 16, level * 16, level * 16)
+    except OSError:
+        pass
 
 
 def show(pix):