Skip to content

Commit

Permalink
Adds 'anatomy of planets.py' documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Christie committed Feb 27, 2022
1 parent 1290fab commit 0b07d4e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ At startup the current locations of the planets are displayed
- Press (and hold) **B** to retard the planets
- Press **X** to exit the application's main loop

As you hold **X** or **B** the speed that the planets advance or retard
increases, i.e. they orbit faster the longer you press the buttons.

## Installation
Copy the files in the `pico` directory to the root of the Raspberry Pi Pico.
`main.py` will run automatically when the explorer is switched on.
Expand All @@ -44,6 +47,21 @@ suitable for the Pico Explorer Base.
1. `planets.py`: Added `#pylint: skip-file` to line 1
2. `main.py`: Replaced to use the RV3028 and Pico Explorer Base

**Anatomy of `planets.py`**

The `planets.py` module is unchanged from Dmytro's original. Unfortunately
it has no documentation, and I've reverse-engineered some potentially
helpful documentation here...

- `planets_a` is a list of planet 'bitmaps' (spriies). The array has
eight entries, one for each planet (Mercury to Neptune). Each array
entry is a one-dimensional list of numbers but is 'interpreted' as
consecutive blocks (rows) of 5-byte values for each pixel in the bitmap.
The five bytes are the pixel's 'x', 'y', 'red', 'green', and 'blue' value.
The bitmap size is 7x7 with 'x' and 'y' values ranging from 47 to 50.
The pixel at 50,50 (the centre of the bitmap) is placed on planet's
_coordinate_.

---

[dmytro panin]: https://github.com/dr-mod
Expand Down

0 comments on commit 0b07d4e

Please sign in to comment.